Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: src/common/solaris/guid_creator.cc

Issue 1333243002: solaris: fix spurious ; (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: fix BUG line Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2007, Google Inc. 1 // Copyright (c) 2007, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 *reinterpret_cast<uint32_t*>(&guid->data4[4]) = random(); 59 *reinterpret_cast<uint32_t*>(&guid->data4[4]) = random();
60 return true; 60 return true;
61 } 61 }
62 }; 62 };
63 63
64 // Guid generator. 64 // Guid generator.
65 const GUIDGenerator kGuidGenerator; 65 const GUIDGenerator kGuidGenerator;
66 66
67 bool CreateGUID(GUID *guid) { 67 bool CreateGUID(GUID *guid) {
68 return kGuidGenerator.CreateGUID(guid); 68 return kGuidGenerator.CreateGUID(guid);
69 }; 69 }
70 70
71 // Parse guid to string. 71 // Parse guid to string.
72 bool GUIDToString(const GUID *guid, char *buf, int buf_len) { 72 bool GUIDToString(const GUID *guid, char *buf, int buf_len) {
73 // Should allow more space the the max length of GUID. 73 // Should allow more space the the max length of GUID.
74 assert(buf_len > kGUIDStringLength); 74 assert(buf_len > kGUIDStringLength);
75 int num = snprintf(buf, buf_len, kGUIDFormatString, 75 int num = snprintf(buf, buf_len, kGUIDFormatString,
76 guid->data1, guid->data2, guid->data3, 76 guid->data1, guid->data2, guid->data3,
77 *reinterpret_cast<const uint32_t *>(&(guid->data4[0])), 77 *reinterpret_cast<const uint32_t *>(&(guid->data4[0])),
78 *reinterpret_cast<const uint32_t *>(&(guid->data4[4]))); 78 *reinterpret_cast<const uint32_t *>(&(guid->data4[4])));
79 if (num != kGUIDStringLength) 79 if (num != kGUIDStringLength)
80 return false; 80 return false;
81 81
82 buf[num] = '\0'; 82 buf[num] = '\0';
83 return true; 83 return true;
84 } 84 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698