aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/lluuid.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llmath/lluuid.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/lluuid.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/linden/indra/llmath/lluuid.cpp b/linden/indra/llmath/lluuid.cpp
index 3fb31a6..b943fd9 100644
--- a/linden/indra/llmath/lluuid.cpp
+++ b/linden/indra/llmath/lluuid.cpp
@@ -170,15 +170,15 @@ void LLUUID::toString(char *out) const
170 170
171void LLUUID::toCompressedString(char *out) const 171void LLUUID::toCompressedString(char *out) const
172{ 172{
173 memcpy(out, mData, UUID_BYTES); 173 memcpy(out, mData, UUID_BYTES); /* Flawfinder: ignore */
174 out[UUID_BYTES] = '\0'; 174 out[UUID_BYTES] = '\0';
175} 175}
176 176
177LLString LLUUID::getString() const 177std::string LLUUID::asString() const
178{ 178{
179 char str[UUID_STR_SIZE]; 179 char str[UUID_STR_SIZE]; /* Flawfinder: ignore */
180 toString(str); 180 toString(str);
181 return LLString(str); 181 return std::string(str);
182} 182}
183 183
184BOOL LLUUID::set(const std::string& in_string, BOOL emit) 184BOOL LLUUID::set(const std::string& in_string, BOOL emit)
@@ -203,11 +203,11 @@ BOOL LLUUID::set(const char *in_string, BOOL emit)
203 return TRUE; 203 return TRUE;
204 } 204 }
205 205
206 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) 206 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) /* Flawfinder: ignore */
207 { 207 {
208 // I'm a moron. First implementation didn't have the right UUID format. 208 // I'm a moron. First implementation didn't have the right UUID format.
209 // Shouldn't see any of these any more 209 // Shouldn't see any of these any more
210 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) 210 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) /* Flawfinder: ignore */
211 { 211 {
212 if(emit) 212 if(emit)
213 { 213 {
@@ -307,10 +307,10 @@ BOOL LLUUID::validate(const char *in_string)
307 { 307 {
308 return FALSE; 308 return FALSE;
309 } 309 }
310 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) 310 if (strlen(in_string) != (UUID_STR_LENGTH - 1)) /* Flawfinder: ignore */
311 { 311 {
312 // I'm a moron. First implementation didn't have the right UUID format. 312 // I'm a moron. First implementation didn't have the right UUID format.
313 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) 313 if (strlen(in_string) == (UUID_STR_LENGTH - 2)) /* Flawfinder: ignore */
314 { 314 {
315 broken_format = TRUE; 315 broken_format = TRUE;
316 } 316 }
@@ -414,7 +414,7 @@ std::ostream& operator<<(std::ostream& s, const LLUUID &uuid)
414std::istream& operator>>(std::istream &s, LLUUID &uuid) 414std::istream& operator>>(std::istream &s, LLUUID &uuid)
415{ 415{
416 U32 i; 416 U32 i;
417 char uuid_str[UUID_STR_LENGTH]; 417 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
418 for (i = 0; i < UUID_STR_LENGTH-1; i++) 418 for (i = 0; i < UUID_STR_LENGTH-1; i++)
419 { 419 {
420 s >> uuid_str[i]; 420 s >> uuid_str[i];
@@ -480,7 +480,7 @@ S32 LLUUID::getNodeID(unsigned char * node_id)
480 Ncb.ncb_command = NCBASTAT; 480 Ncb.ncb_command = NCBASTAT;
481 Ncb.ncb_lana_num = lenum.lana[i]; 481 Ncb.ncb_lana_num = lenum.lana[i];
482 482
483 strcpy( (char *)Ncb.ncb_callname, "* " ); 483 strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */
484 Ncb.ncb_buffer = (unsigned char *)&Adapter; 484 Ncb.ncb_buffer = (unsigned char *)&Adapter;
485 Ncb.ncb_length = sizeof(Adapter); 485 Ncb.ncb_length = sizeof(Adapter);
486 486
@@ -497,7 +497,7 @@ S32 LLUUID::getNodeID(unsigned char * node_id)
497// Adapter.adapt.adapter_address[3], 497// Adapter.adapt.adapter_address[3],
498// Adapter.adapt.adapter_address[4], 498// Adapter.adapt.adapter_address[4],
499// Adapter.adapt.adapter_address[5] ); 499// Adapter.adapt.adapter_address[5] );
500 memcpy(node_id,Adapter.adapt.adapter_address,6); 500 memcpy(node_id,Adapter.adapt.adapter_address,6); /* Flawfinder: ignore */
501 retval = 1; 501 retval = 1;
502 502
503 } 503 }
@@ -652,7 +652,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
652 n = ifc.ifc_len; 652 n = ifc.ifc_len;
653 for (i = 0; i < n; i+= ifreq_size(*ifr) ) { 653 for (i = 0; i < n; i+= ifreq_size(*ifr) ) {
654 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); 654 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
655 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); 655 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); /* Flawfinder: ignore */
656#ifdef SIOCGIFHWADDR 656#ifdef SIOCGIFHWADDR
657 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) 657 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0)
658 continue; 658 continue;
@@ -674,7 +674,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
674 if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) 674 if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])
675 continue; 675 continue;
676 if (node_id) { 676 if (node_id) {
677 memcpy(node_id, a, 6); 677 memcpy(node_id, a, 6); /* Flawfinder: ignore */
678 close(sd); 678 close(sd);
679 return 1; 679 return 1;
680 } 680 }
@@ -783,7 +783,7 @@ void LLUUID::generate()
783 // Create a UUID. 783 // Create a UUID.
784 uuid_time_t timestamp; 784 uuid_time_t timestamp;
785 785
786 static unsigned char node_id[6]; 786 static unsigned char node_id[6]; /* Flawfinder: ignore */
787 static int has_init = 0; 787 static int has_init = 0;
788 788
789 // Create a UUID. 789 // Create a UUID.
@@ -827,7 +827,7 @@ void LLUUID::generate()
827 if (clock_seq == 0) clock_seq++; 827 if (clock_seq == 0) clock_seq++;
828 } 828 }
829 829
830 memcpy(mData+10, node_id, 6); 830 memcpy(mData+10, node_id, 6); /* Flawfinder: ignore */
831 U32 tmp; 831 U32 tmp;
832 tmp = timestamp.low; 832 tmp = timestamp.low;
833 mData[3] = (unsigned char) tmp; 833 mData[3] = (unsigned char) tmp;
@@ -865,7 +865,7 @@ void LLUUID::generate()
865 865
866U32 LLUUID::getRandomSeed() 866U32 LLUUID::getRandomSeed()
867{ 867{
868 static unsigned char seed[16]; 868 static unsigned char seed[16]; /* Flawfinder: ignore */
869 869
870 getNodeID(&seed[0]); 870 getNodeID(&seed[0]);
871 seed[6]='\0'; 871 seed[6]='\0';