Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/26858
Change subject: payloads: Use NULL instead of 0 for pointer ......................................................................
payloads: Use NULL instead of 0 for pointer
Change-Id: I91d13586b92a106822df412fdc386d75968e3fb8 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M payloads/bayou/payload.c M payloads/libpayload/arch/arm/virtual.c M payloads/libpayload/curses/PDCurses/pdcurses/scanw.c M payloads/libpayload/curses/PDCurses/pdcurses/slk.c M payloads/libpayload/curses/PDCurses/x11/pdcx11.c M payloads/libpayload/curses/PDCurses/x11/x11.c M payloads/libpayload/curses/form/frm_driver.c M payloads/libpayload/curses/menu/m_global.c M payloads/libpayload/curses/menu/m_item_new.c M payloads/libpayload/drivers/usb/usb.c M payloads/libpayload/drivers/usb/xhci_devconf.c M payloads/libpayload/drivers/video/video.c 12 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/26858/1
diff --git a/payloads/bayou/payload.c b/payloads/bayou/payload.c index a76e49f..bd94c7e 100644 --- a/payloads/bayou/payload.c +++ b/payloads/bayou/payload.c @@ -101,7 +101,7 @@
ptr += strnlen(ptr, len - i);
- if (ptr < ((char *)params + len) && *ptr == 0) + if (ptr < ((char *)params + len) && *ptr == NULL) ptr++; } } diff --git a/payloads/libpayload/arch/arm/virtual.c b/payloads/libpayload/arch/arm/virtual.c index acca057..56ec97d 100644 --- a/payloads/libpayload/arch/arm/virtual.c +++ b/payloads/libpayload/arch/arm/virtual.c @@ -74,7 +74,7 @@ #define PAGE_SHIFT 12 #define PGD_MASK (~0 << PAGE_SHIFT)
-static pmd_t *ttb_buff = 0; +static pmd_t *ttb_buff = NULL; static uintptr_t work_block; static pmd_t original_map;
diff --git a/payloads/libpayload/curses/PDCurses/pdcurses/scanw.c b/payloads/libpayload/curses/PDCurses/pdcurses/scanw.c index 47f2050..c2cb968 100644 --- a/payloads/libpayload/curses/PDCurses/pdcurses/scanw.c +++ b/payloads/libpayload/curses/PDCurses/pdcurses/scanw.c @@ -317,7 +317,7 @@ } if (assign) { - *char_ptr = 0; + *char_ptr = NULL; ++count; } if (!c) diff --git a/payloads/libpayload/curses/PDCurses/pdcurses/slk.c b/payloads/libpayload/curses/PDCurses/pdcurses/slk.c index 1491e2b..8b97df8 100644 --- a/payloads/libpayload/curses/PDCurses/pdcurses/slk.c +++ b/payloads/libpayload/curses/PDCurses/pdcurses/slk.c @@ -222,7 +222,7 @@ { /* Clear the label */
- *slk[labnum].label = 0; + *slk[labnum].label = NULL; slk[labnum].format = 0; slk[labnum].len = 0; } @@ -582,7 +582,7 @@ { /* Clear the label */
- *slk[labnum].label = 0; + *slk[labnum].label = NULL; slk[labnum].format = 0; slk[labnum].len = 0; } diff --git a/payloads/libpayload/curses/PDCurses/x11/pdcx11.c b/payloads/libpayload/curses/PDCurses/x11/pdcx11.c index 370cedb..1857f98 100644 --- a/payloads/libpayload/curses/PDCurses/x11/pdcx11.c +++ b/payloads/libpayload/curses/PDCurses/x11/pdcx11.c @@ -44,7 +44,7 @@
void XC_release_line_lock(int row) { - *(Xcurscr + XCURSCR_FLAG_OFF + row) = 0; + *(Xcurscr + XCURSCR_FLAG_OFF + row) = NULL; }
int XC_write_socket(int sock_num, const void *buf, int len) diff --git a/payloads/libpayload/curses/PDCurses/x11/x11.c b/payloads/libpayload/curses/PDCurses/x11/x11.c index 69c3199..74fb0ca 100644 --- a/payloads/libpayload/curses/PDCurses/x11/x11.c +++ b/payloads/libpayload/curses/PDCurses/x11/x11.c @@ -956,7 +956,7 @@ (start_col * sizeof(chtype))), row, start_col, num_cols, FALSE);
- *(Xcurscr + XCURSCR_LENGTH_OFF + row) = 0; + *(Xcurscr + XCURSCR_LENGTH_OFF + row) = NULL;
XC_release_line_lock(row); } diff --git a/payloads/libpayload/curses/form/frm_driver.c b/payloads/libpayload/curses/form/frm_driver.c index e058d19..7752b41 100644 --- a/payloads/libpayload/curses/form/frm_driver.c +++ b/payloads/libpayload/curses/form/frm_driver.c @@ -4393,7 +4393,7 @@ unsigned int len;
#if USE_WIDEC_SUPPORT - FIELD_CELL *widevalue = 0; + FIELD_CELL *widevalue = NULL; #endif
T((T_CALLED("set_field_buffer(%p,%d,%s)"), (void *)field, buffer, _nc_visbuf(value))); @@ -4504,7 +4504,7 @@ NCURSES_EXPORT(char *) field_buffer(const FIELD *field, int buffer) { - char *result = 0; + char *result = NULL;
T((T_CALLED("field_buffer(%p,%d)"), (const void *)field, buffer));
@@ -4572,7 +4572,7 @@ NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *source, int *lengthp) { - wchar_t *result = 0; + wchar_t *result = NULL; wchar_t wch; size_t given = strlen(source); size_t tries; diff --git a/payloads/libpayload/curses/menu/m_global.c b/payloads/libpayload/curses/menu/m_global.c index 4509996..fc2725b 100644 --- a/payloads/libpayload/curses/menu/m_global.c +++ b/payloads/libpayload/curses/menu/m_global.c @@ -257,7 +257,7 @@ if (result != 0 && item->str != 0) { int count = mbstowcs(0, item->str, 0); - wchar_t *temp = 0; + wchar_t *temp = NULL;
if (count > 0 && (temp = typeMalloc(wchar_t, 2 + count)) != 0) diff --git a/payloads/libpayload/curses/menu/m_item_new.c b/payloads/libpayload/curses/menu/m_item_new.c index a10ec4b..6766b4e 100644 --- a/payloads/libpayload/curses/menu/m_item_new.c +++ b/payloads/libpayload/curses/menu/m_item_new.c @@ -63,7 +63,7 @@
#if USE_WIDEC_SUPPORT int count = mbstowcs(0, s, 0); - wchar_t *temp = 0; + wchar_t *temp = NULL;
assert(s);
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index bb42f89..92ec688 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -34,7 +34,7 @@
#define DR_DESC gen_bmRequestType(device_to_host, standard_type, dev_recp)
-hci_t *usb_hcs = 0; +hci_t *usb_hcs = NULL;
hci_t * new_controller (void) diff --git a/payloads/libpayload/drivers/usb/xhci_devconf.c b/payloads/libpayload/drivers/usb/xhci_devconf.c index b697b0f..9ecd950 100644 --- a/payloads/libpayload/drivers/usb/xhci_devconf.c +++ b/payloads/libpayload/drivers/usb/xhci_devconf.c @@ -72,7 +72,7 @@ *tt = hubaddr; *tt_port = hubport; } - return *tt != 0; + return *tt != NULL; }
static void diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c index 71140f0..4461895 100644 --- a/payloads/libpayload/drivers/video/video.c +++ b/payloads/libpayload/drivers/video/video.c @@ -67,7 +67,7 @@ *cols = console->columns; *rows = console->rows; } else { - *cols = *rows = 0; + *cols = *rows = NULL; } }