2012/6/1 Pete Batard <p...@akeo.ie>: > On 2012.06.01 13:49, Ludovic Rousseau wrote: >> - const char *prefix; >> + const char *prefix = "unknown"; >> struct timeval now; >> int global_debug; >> static int has_debug_header_been_displayed = 0; >> @@ -1828,8 +1828,8 @@ void usbi_log_v(struct libusb_context *ctx, enum >> usbi_log_level level, >> case LOG_LEVEL_DEBUG: >> prefix = "debug"; >> break; >> + case LOG_LEVEL_NONE: >> default: >> - prefix = "unknown"; >> break; >> } > > Something seems a bit redundant here. > > Either prefix needs to be initialized and then you can use: > > + case LOG_LEVEL_NONE: > + break > > or the LOG_LEVEL_NONE case is merged with default as above, and there > should be no need for prefit init. > > > Unless I'm missing something, my preferred approach would be: > > + const char *prefix = ""; > (...) > + case LOG_LEVEL_NONE: > + break
That was my previous (private only) version of the patch. But I thought that using a sane default value for prefix was a good idea. Feel free to use whatever version you prefer. Bye -- Dr. Ludovic Rousseau ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel