Fix compiler warning

uart_posix.c:55:1: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
This commit is contained in:
Ludovic Rousseau 2012-05-14 09:23:18 +00:00
parent 1ac1196af6
commit dfcabf71f0

View file

@ -48,11 +48,11 @@
# if defined(__APPLE__) # if defined(__APPLE__)
// FIXME: find UART connection string for PN53X device on Mac OS X when multiples devices are used // FIXME: find UART connection string for PN53X device on Mac OS X when multiples devices are used
char *serial_ports_device_radix[] = { "tty.SLAB_USBtoUART", NULL }; const char *serial_ports_device_radix[] = { "tty.SLAB_USBtoUART", NULL };
# elif defined (__FreeBSD__) || defined (__OpenBSD__) # elif defined (__FreeBSD__) || defined (__OpenBSD__)
char *serial_ports_device_radix[] = { "cuaU", "cuau", NULL }; const char *serial_ports_device_radix[] = { "cuaU", "cuau", NULL };
# elif defined (__linux__) # elif defined (__linux__)
char *serial_ports_device_radix[] = { "ttyUSB", "ttyS", NULL }; const char *serial_ports_device_radix[] = { "ttyUSB", "ttyS", NULL };
# else # else
# error "Can't determine serial string for your system" # error "Can't determine serial string for your system"
# endif # endif
@ -346,7 +346,7 @@ uart_list_ports (void)
if (!isdigit (pdDirEnt->d_name[strlen (pdDirEnt->d_name) - 1])) if (!isdigit (pdDirEnt->d_name[strlen (pdDirEnt->d_name) - 1]))
continue; continue;
char **p = serial_ports_device_radix; const char **p = serial_ports_device_radix;
while (*p) { while (*p) {
if (!strncmp(pdDirEnt->d_name, *p, strlen (*p))) { if (!strncmp(pdDirEnt->d_name, *p, strlen (*p))) {
char **res2 = realloc (res, (szRes+1) * sizeof (char *)); char **res2 = realloc (res, (szRes+1) * sizeof (char *));