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

Unified Diff: firmware/lib/utility.c

Issue 3186024: Fix utility.c to compile on MSVC. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/utility.c
diff --git a/firmware/lib/utility.c b/firmware/lib/utility.c
index 0ed9712e529ebec6042fd09e8ae656d8088cb31b..3f3ed5d5a5466f1349dc020f2f75bd6710e0a55f 100644
--- a/firmware/lib/utility.c
+++ b/firmware/lib/utility.c
@@ -5,6 +5,7 @@
* Utility functions that need to be built as part of the firmware.
*/
+#include "sysincludes.h"
#include "utility.h"
void* Memset(void* d, const uint8_t c, uint64_t n) {
@@ -16,12 +17,13 @@ void* Memset(void* d, const uint8_t c, uint64_t n) {
}
int SafeMemcmp(const void* s1, const void* s2, size_t n) {
+ const unsigned char* us1 = s1;
+ const unsigned char* us2 = s2;
int result = 0;
+
if (0 == n)
return 1;
- const unsigned char* us1 = s1;
- const unsigned char* us2 = s2;
/* Code snippet without data-dependent branch due to
* Nate Lawson (nate@root.org) of Root Labs. */
while (n--)
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698