RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: popt Date: 05-Sep-2011 13:26:40 Branch: HEAD Handle: 2011090511263900 Modified files: popt CHANGES popthelp.c system.h test1.c Log: merge commit 8396019 from git pull request https://github.com/devzero2000/POPT/pull/2 "Work around missing format for long long in windows; fix warnings" by asenm (Matt Arsenault) Summary: Revision Changes Path 1.167 +4 -0 popt/CHANGES 1.104 +1 -1 popt/popthelp.c 1.24 +22 -11 popt/system.h 1.53 +2 -2 popt/test1.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: popt/CHANGES ============================================================================ $ cvs diff -u -r1.166 -r1.167 CHANGES --- popt/CHANGES 5 Sep 2011 11:20:27 -0000 1.166 +++ popt/CHANGES 5 Sep 2011 11:26:39 -0000 1.167 @@ -1,4 +1,8 @@ 1.17 -> 2.0: + - devzero2000: merge commit 8396019 from git pull request + https://github.com/devzero2000/POPT/pull/2 + "Work around missing format for long long in windows; fix warnings" + by asenm (Matt Arsenault) - devzero2000: merge commit ea2978d from git pull request https://github.com/devzero2000/POPT/pull/2 "Fix build with MinGW 32/64 + MSVC" by arsenm @@ . patch -p0 <<'@@ .' Index: popt/popthelp.c ============================================================================ $ cvs diff -u -r1.103 -r1.104 popthelp.c --- popt/popthelp.c 16 Jun 2011 15:26:43 -0000 1.103 +++ popt/popthelp.c 5 Sep 2011 11:26:39 -0000 1.104 @@ -265,7 +265,7 @@ le += sprintf(le, "%ld", arg.longp[0]); break; case POPT_ARG_LONGLONG: - le += sprintf(le, "%lld", arg.longlongp[0]); + le += sprintf(le, "%" LONG_LONG_FORMAT, arg.longlongp[0]); break; case POPT_ARG_FLOAT: { double aDouble = (double) arg.floatp[0]; @@ . patch -p0 <<'@@ .' Index: popt/system.h ============================================================================ $ cvs diff -u -r1.23 -r1.24 system.h --- popt/system.h 5 Sep 2011 11:20:27 -0000 1.23 +++ popt/system.h 5 Sep 2011 11:26:39 -0000 1.24 @@ -7,7 +7,6 @@ #endif - #if defined (__GLIBC__) && defined(__LCLINT__) /*@-declundef@*/ /*@unchecked@*/ @@ -54,10 +53,18 @@ #include <unistd.h> #endif + +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(x) +#endif +#define UNUSED(x) x __attribute__((__unused__)) + + #ifdef _MSC_VER # define inline __inline #endif + #if defined(_MSC_VER) || defined(__MINGW32__) #define _CRT_SECURE_NO_WARNINGS 1 #include <io.h> @@ -73,6 +80,10 @@ #define S_ISGID 00020000 #define S_ISVTX 00010000 +/* I haven't discovered a better way to work around these format + specifier problems */ +#define LONG_LONG_FORMAT "I64d" + /* CHECKME */ #define S_IWGRP 00000020 @@ -112,17 +123,22 @@ #define lseek _lseek /* Pretend to be root to replace these */ -static inline int setuid(int x) { return 1; } +static inline int setuid(UNUSED(int x)) { return 1; } static inline int getuid(void) { return 0; } -static inline int seteuid(int x) { return 1; } +static inline int seteuid(UNUSED(int x)) { return 1; } static inline int geteuid(void) { return 0; } -static inline int setgid(int x) { return 1; } +static inline int setgid(UNUSED(int x)) { return 1; } static inline int getgid(void) { return 0; } -static inline int setegid(int x) { return 1; } +static inline int setegid(UNUSED(int x)) { return 1; } + + +#else + +#define LONG_LONG_FORMAT "lld" #endif /* defined(_MSC_VER) || defined(__MINGW32__) */ @@ -186,12 +202,7 @@ #define getenv(_s) __secure_getenv(_s) #endif -#if !defined(__GNUC__) && !defined(__attribute__) -#define __attribute__(x) -#endif -#define UNUSED(x) x __attribute__((__unused__)) - /* Include configmake.h autogenerated from Makefile.am */ - #include "configmake.h" #include "popt.h" + @@ . patch -p0 <<'@@ .' Index: popt/test1.c ============================================================================ $ cvs diff -u -r1.52 -r1.53 test1.c --- popt/test1.c 5 Sep 2011 11:20:27 -0000 1.52 +++ popt/test1.c 5 Sep 2011 11:26:39 -0000 1.53 @@ -91,7 +91,7 @@ "123456789+123456789+123456789+123456789+123456789+ " "123456789+123456789+123456789+123456789+123456789+ "; /*@unchecked@*/ /*@null@*/ -static char * nStr = NULL; +static char * nStr = NULL; /*@unchecked@*/ static struct poptOption moreCallbackArgs[] = { @@ -334,7 +334,7 @@ if (aLong != bLong) fprintf(stdout, " aLong: %ld", aLong); if (aLongLong != bLongLong) - fprintf(stdout, " aLongLong: %lld", aLongLong); + fprintf(stdout, " aLongLong: %" LONG_LONG_FORMAT, aLongLong); /*@-realcompare@*/ if (aFloat != bFloat) fprintf(stdout, " aFloat: %g", (double)aFloat); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org