diff options
author | Aaron Durbin <adurbin@chromium.org> | 2013-02-26 09:02:02 -0600 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-02-26 09:07:50 -0800 |
commit | 9d7d0cbe132e6660885b72d6c46a2bbc982dca25 (patch) | |
tree | 996629f8cc431c59ac8f3cc69466904b11e2d892 | |
parent | 612797edfad45e25b1fb0dc398e02e1d7d8286a2 (diff) | |
download | vboot-9d7d0cbe132e6660885b72d6c46a2bbc982dca25.tar.gz |
vboot_display: fix -Wwrite-strings compiler errors
VbHWID() returns a fixed string which can also be a returning a
string that lives in the read only text segment or read only flash.
Because of this the compiler will rightfully error when built with
-Werror and -Wwrite-strings because the const qualifier is being
ignored. Correct this and the ripple effect in VbRenderTextAtPos().
VbRenderTextAtPos() should be using constant strings anyhow.
BUG=chrome-os-partner:17695
BRANCH=None
TEST=built fwlib with -Werror -Wwrite-strings. Compiles correctly. make
runtests still passes as well.
Change-Id: Id03a783d2d9b5de4cc3b3ce0fa6d74934751cca4
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44043
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | firmware/lib/include/vboot_display.h | 4 | ||||
-rw-r--r-- | firmware/lib/vboot_display.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/firmware/lib/include/vboot_display.h b/firmware/lib/include/vboot_display.h index 52730b9e..17ce48b8 100644 --- a/firmware/lib/include/vboot_display.h +++ b/firmware/lib/include/vboot_display.h @@ -34,7 +34,7 @@ ImageInfo *VbFindFontGlyph(VbFont_t *font, uint32_t ascii, /** * Try to display the specified text at a particular position. */ -void VbRenderTextAtPos(char *text, int right_to_left, +void VbRenderTextAtPos(const char *text, int right_to_left, uint32_t x, uint32_t y, VbFont_t *font); /** @@ -45,7 +45,7 @@ const char *RecoveryReasonString(uint8_t code); /** * Return a fixed string representing the HWID. */ -char *VbHWID(VbCommonParams *cparams); +const char *VbHWID(VbCommonParams *cparams); /** * Get the number of localizations in the GBB bitmap data. diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index 7c916d01..9abc51d9 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -46,7 +46,7 @@ VbError_t VbGetLocalizationCount(VbCommonParams *cparams, uint32_t *count) return VBERROR_SUCCESS; } -char *VbHWID(VbCommonParams *cparams) +const char *VbHWID(VbCommonParams *cparams) { GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)cparams->gbb_data; @@ -120,7 +120,7 @@ ImageInfo *VbFindFontGlyph(VbFont_t *font, uint32_t ascii, return &(entry->info); } -void VbRenderTextAtPos(char *text, int right_to_left, +void VbRenderTextAtPos(const char *text, int right_to_left, uint32_t x, uint32_t y, VbFont_t *font) { int i; @@ -182,7 +182,7 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen, uint32_t offset; uint32_t i; VbFont_t *font; - char *text_to_show; + const char *text_to_show; int rtol = 0; char outbuf[OUTBUF_LEN] = ""; uint32_t used = 0; |