From 47b705b432ad6e5a7aaeeeff1afeaa4b743cfe40 Mon Sep 17 00:00:00 2001 From: cgf Date: Fri, 29 Jan 2010 17:37:54 +0000 Subject: [PATCH] * libc/strfmon.c (__setup_vars): Fix compiler warning about assigning const strings. Compare a pointer to NULL rather than '\0'. * dll_init.cc (dll_dllcrt0_1): Minor comment fix. * pipe.cc (fhandler_pipe::create_selectable): Remove Win9x accommodation. --- winsup/cygwin/ChangeLog | 10 ++++++++++ winsup/cygwin/dll_init.cc | 2 +- winsup/cygwin/libc/strfmon.c | 5 +++-- winsup/cygwin/pipe.cc | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ce0a3f7a93..881e712160 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,13 @@ +2010-01-29 Christopher Faylor + + * libc/strfmon.c (__setup_vars): Fix compiler warning about assigning + const strings. Compare a pointer to NULL rather than '\0'. + + * dll_init.cc (dll_dllcrt0_1): Minor comment fix. + + * pipe.cc (fhandler_pipe::create_selectable): Remove Win9x + accommodation. + 2010-01-29 Corinna Vinschen Throughout, use FileBothDirectoryInformation info class rather than diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index f1b9a9f923..20cc4f9cea 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -384,7 +384,7 @@ dll_dllcrt0_1 (VOID *x) res = (DWORD) d; } -/* OBSOLETE: This function is obsolescent and will go away in the +/* OBSOLETE: This function is obsolete and will go away in the future. Cygwin can now handle being loaded from a noncygwin app using the same entry point. */ diff --git a/winsup/cygwin/libc/strfmon.c b/winsup/cygwin/libc/strfmon.c index 2c2523ee82..ac23aa05bc 100644 --- a/winsup/cygwin/libc/strfmon.c +++ b/winsup/cygwin/libc/strfmon.c @@ -413,12 +413,13 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, char **signstr) { struct lconv *lc = localeconv(); + static char negative[] = "-"; if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { *cs_precedes = lc->int_n_cs_precedes; *sep_by_space = lc->int_n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; - *signstr = (lc->negative_sign == '\0') ? "-" + *signstr = (lc->negative_sign == NULL) ? negative : lc->negative_sign; } else if (flags & USE_INTL_CURRENCY) { *cs_precedes = lc->int_p_cs_precedes; @@ -429,7 +430,7 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, *cs_precedes = lc->n_cs_precedes; *sep_by_space = lc->n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; - *signstr = (lc->negative_sign == '\0') ? "-" + *signstr = (lc->negative_sign == NULL) ? negative : lc->negative_sign; } else { *cs_precedes = lc->p_cs_precedes; diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 2d351fd688..5194856bcc 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -251,7 +251,7 @@ fhandler_pipe::create_selectable (LPSECURITY_ATTRIBUTES sa_ptr, HANDLE& r, psize, NMPWAIT_USE_DEFAULT_WAIT, sa_ptr); /* Win 95 seems to return NULL instead of INVALID_HANDLE_VALUE */ - if (r && r != INVALID_HANDLE_VALUE) + if (r != INVALID_HANDLE_VALUE) { debug_printf ("pipe read handle %p", r); break; -- 2.11.0