mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 08:31:52 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user