Module: sems Branch: master Commit: 2382c07ce0e73030634e839b9ac30c8321019511 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=2382c07ce0e73030634e839b9ac30c8321019511
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Tue Mar 22 17:28:34 2011 +0100 b/f: work around gcc 4.2.1 (apple). Curiously, LONG_MAX is equal to LLONG_MAX on apple's gcc 4.2.1. GCC then complains that the test is always false (log_offset == ..). --- tools/logfile-splitter.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/logfile-splitter.cpp b/tools/logfile-splitter.cpp index 638bbe8..0d07e10 100644 --- a/tools/logfile-splitter.cpp +++ b/tools/logfile-splitter.cpp @@ -31,10 +31,10 @@ int main(int argc, char *argv[]) exit(1); } - int log_offset = -1; + long int log_offset = -1; char* endptr; - log_offset = strtol(argv[3], &endptr, 10); // offset of thread - if ((errno == ERANGE && (log_offset == LONG_MAX || log_offset == LONG_MIN)) + log_offset = strtoll(argv[3], &endptr, 10); // offset of thread + if ((errno == ERANGE && (log_offset == LLONG_MAX || log_offset == LLONG_MIN)) || (errno != 0 && log_offset == 0) || endptr == argv[3] || log_offset<0) { cerr << "invalid thread column ID " << argv[3] << endl; exit(1); _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
