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

Side by Side Diff: src/platform/vboot_reference/common/utility_stub.c

Issue 1729006: Add helper functions and files for gpt tests. (Closed)
Patch Set: fix for code review Created 10 years, 8 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 | « src/platform/vboot_reference/common/include/utility.h ('k') | 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) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 * 4 *
5 * Stub implementations of utility functions which call their linux-specific 5 * Stub implementations of utility functions which call their linux-specific
6 * equivalents. 6 * equivalents.
7 */ 7 */
8 8
9 #include "utility.h" 9 #include "utility.h"
10 10
(...skipping 24 matching lines...) Expand all
35 /* Fatal Error. We must abort. */ 35 /* Fatal Error. We must abort. */
36 abort(); 36 abort();
37 } 37 }
38 return p; 38 return p;
39 } 39 }
40 40
41 void Free(void* ptr) { 41 void Free(void* ptr) {
42 free(ptr); 42 free(ptr);
43 } 43 }
44 44
45 int Memcmp(const void* src1, const void* src2, size_t n) {
46 return memcmp(src1, src2, n);
47 }
48
45 void* Memcpy(void* dest, const void* src, size_t n) { 49 void* Memcpy(void* dest, const void* src, size_t n) {
46 return memcpy(dest, src, n); 50 return memcpy(dest, src, n);
47 } 51 }
48 52
49 void* Memset(void* dest, const uint8_t c, size_t n) { 53 void* Memset(void* dest, const uint8_t c, size_t n) {
50 while (n--) { 54 while (n--) {
51 *((uint8_t*)dest++) = c; 55 *((uint8_t*)dest++) = c;
52 } 56 }
53 return dest; 57 return dest;
54 } 58 }
(...skipping 30 matching lines...) Expand all
85 return NULL; 89 return NULL;
86 if (len > state->remaining_len) { 90 if (len > state->remaining_len) {
87 state->overrun = 1; 91 state->overrun = 1;
88 return NULL; 92 return NULL;
89 } 93 }
90 Memcpy(state->remaining_buf, src, len); 94 Memcpy(state->remaining_buf, src, len);
91 state->remaining_buf += len; 95 state->remaining_buf += len;
92 state->remaining_len -= len; 96 state->remaining_len -= len;
93 return src; 97 return src;
94 } 98 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/common/include/utility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698