summaryrefslogtreecommitdiff
path: root/host/lib/host_misc.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2017-01-03 13:49:18 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-12 15:56:27 -0800
commit21015898b39aa8742057ed6e6423c308c8d0a15d (patch)
tree8221b6a48e13d8cdf15820cc92247167f8ac5fe0 /host/lib/host_misc.c
parentdf4eb2bb7be9d61bfe9bdf6c33f836f358b18cf6 (diff)
downloadvboot-21015898b39aa8742057ed6e6423c308c8d0a15d.tar.gz
firmware: replace VBDEBUG(()) macro with VB2_DEBUG()
The original VBDEBUG macro used doubly-nested parens to work with MSVC, which didn't support varargs in macros. We now only use more modern compilers, so replace it with the VB2_DEBUG macro and get rid of the ugly and fragile double parens. BUG=chromium:611535 BRANCH=none TEST=make runtests; build_packages --board=reef chromeos-firmware Change-Id: Ifc0cb0733b14daaa1fde095fab7da4215a538c77 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/425133 Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'host/lib/host_misc.c')
-rw-r--r--host/lib/host_misc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/host_misc.c b/host/lib/host_misc.c
index 611253b9..250ca99d 100644
--- a/host/lib/host_misc.c
+++ b/host/lib/host_misc.c
@@ -30,7 +30,7 @@ uint8_t* ReadFile(const char* filename, uint64_t* sizeptr)
f = fopen(filename, "rb");
if (!f) {
- VBDEBUG(("Unable to open file %s\n", filename));
+ fprintf(stderr, "Unable to open file %s\n", filename);
return NULL;
}
@@ -49,7 +49,7 @@ uint8_t* ReadFile(const char* filename, uint64_t* sizeptr)
}
if(1 != fread(buf, size, 1, f)) {
- VBDEBUG(("Unable to read from file %s\n", filename));
+ fprintf(stderr, "Unable to read from file %s\n", filename);
fclose(f);
free(buf);
return NULL;
@@ -103,12 +103,12 @@ int WriteFile(const char* filename, const void *data, uint64_t size)
{
FILE *f = fopen(filename, "wb");
if (!f) {
- VBDEBUG(("Unable to open file %s\n", filename));
+ fprintf(stderr, "Unable to open file %s\n", filename);
return 1;
}
if (1 != fwrite(data, size, 1, f)) {
- VBDEBUG(("Unable to write to file %s\n", filename));
+ fprintf(stderr, "Unable to write to file %s\n", filename);
fclose(f);
unlink(filename); /* Delete any partial file */
return 1;