Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/isdn/isdnd Fix format strings to deal with 64bit ti...



details:   https://anonhg.NetBSD.org/src/rev/d615ec36b27f
branches:  trunk
changeset: 777701:d615ec36b27f
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Mar 01 22:31:48 2012 +0000

description:
Fix format strings to deal with 64bit time_t.

diffstat:

 usr.sbin/isdn/isdnd/isdnd.h     |   4 ++--
 usr.sbin/isdn/isdnd/rates.c     |   8 ++++----
 usr.sbin/isdn/isdnd/rc_config.c |  10 +++++-----
 usr.sbin/isdn/isdnd/support.c   |   4 ++--
 usr.sbin/isdn/isdnd/timer.c     |  20 ++++++++++----------
 5 files changed, 23 insertions(+), 23 deletions(-)

diffs (167 lines):

diff -r f8071eb3b55e -r d615ec36b27f usr.sbin/isdn/isdnd/isdnd.h
--- a/usr.sbin/isdn/isdnd/isdnd.h       Thu Mar 01 22:30:40 2012 +0000
+++ b/usr.sbin/isdn/isdnd/isdnd.h       Thu Mar 01 22:31:48 2012 +0000
@@ -27,7 +27,7 @@
  *     i4b daemon - main header file
  *     -----------------------------
  *
- *     $Id: isdnd.h,v 1.17 2011/08/31 13:32:37 joerg Exp $ 
+ *     $Id: isdnd.h,v 1.18 2012/03/01 22:31:48 joerg Exp $ 
  *
  * $FreeBSD$
  *
@@ -791,7 +791,7 @@
 void init_single_controller_protocol ( struct isdn_ctrl_state *ctrl );
 void init_log ( void );
 void init_screen ( void );
-void logit ( int what, const char *fmt, ... );
+void logit ( int what, const char *fmt, ... ) __printflike(2, 3);
 int main ( int argc, char **argv );
 void msg_accounting ( msg_accounting_ind_t *mp );
 void msg_alert_ind ( msg_alert_ind_t *mp );
diff -r f8071eb3b55e -r d615ec36b27f usr.sbin/isdn/isdnd/rates.c
--- a/usr.sbin/isdn/isdnd/rates.c       Thu Mar 01 22:30:40 2012 +0000
+++ b/usr.sbin/isdn/isdnd/rates.c       Thu Mar 01 22:31:48 2012 +0000
@@ -35,7 +35,7 @@
  *     i4b daemon - charging rates description file handling
  *     -----------------------------------------------------
  *
- *     $Id: rates.c,v 1.6 2004/10/30 08:19:30 dsl Exp $ 
+ *     $Id: rates.c,v 1.7 2012/03/01 22:31:48 joerg Exp $ 
  *
  * $FreeBSD$
  *
@@ -391,8 +391,8 @@
        {
        case ULSRC_CMDL:        /* specified on commandline     */
                if (dolog)
-                       logit(LL_CHD, "%05d %s rate %d sec/unit (cmdl)",
-                               cep->cdid, cep->name, unit_length);
+                       logit(LL_CHD, "%05d %s rate %jd sec/unit (cmdl)",
+                               cep->cdid, cep->name, (intmax_t)unit_length);
                return(unit_length);
                break;
 
@@ -493,7 +493,7 @@
                if ((time_now >= hd->start_time ) &&
                    (time_now < hd->end_time ))
                {
-                       DBGL(DL_RATES, (logit(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d:%2.2d, end=%d:2.2d, current=%d:%2.2d)",
+                       DBGL(DL_RATES, (logit(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d:%2.2d, end=%d:%2.2d, current=%d:%2.2d)",
                                hd->rate,
                                ptr->tm_wday,
                                hd->start_time/60, hd->start_time%60,
diff -r f8071eb3b55e -r d615ec36b27f usr.sbin/isdn/isdnd/rc_config.c
--- a/usr.sbin/isdn/isdnd/rc_config.c   Thu Mar 01 22:30:40 2012 +0000
+++ b/usr.sbin/isdn/isdnd/rc_config.c   Thu Mar 01 22:31:48 2012 +0000
@@ -27,7 +27,7 @@
  *     i4b daemon - config file processing
  *     -----------------------------------
  *
- *     $Id: rc_config.c,v 1.25 2009/04/16 05:56:32 lukem Exp $ 
+ *     $Id: rc_config.c,v 1.26 2012/03/01 22:31:48 joerg Exp $ 
  *
  * $FreeBSD$
  *
@@ -454,13 +454,13 @@
                        FILE *fp;
                        int s, l;
                        int n;
-                       DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: budget-callbacksfile = %s", yylval.str)));
+                       DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: budget-callbacksfile = %s", current_cfe->name, yylval.str)));
                        fp = fopen(yylval.str, "r");
                        if (fp != NULL)
                        {
                                if ((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) != 3)
                                {
-                                       DBGL(DL_RCCF, (logit(LL_DBG, "entry %d: initializing budget-callbacksfile %s", current_cfe->name, yylval.str)));
+                                       DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: initializing budget-callbacksfile %s", current_cfe->name, yylval.str)));
                                        fclose(fp);
                                        fp = fopen(yylval.str, "w");
                                        if (fp != NULL) {
@@ -1134,7 +1134,7 @@
                        ret = sscanf(dt, "%d:%d-%d:%d", &fromhr, &frommin, &tohr, &tomin);
                        if (ret !=4)
                        {
-                               logit(LL_ERR, "ERROR parsing config file: timespec [%s] error at line %d!", *dt, lineno);
+                               logit(LL_ERR, "ERROR parsing config file: timespec [%s] error at line %d!", dt, lineno);
                                config_error_flag++;
                                return;
                        }
@@ -1142,7 +1142,7 @@
                        if (fromhr < 0 || fromhr > 24 || tohr < 0 || tohr > 24 ||
                           frommin < 0 || frommin > 59 || tomin < 0 || tomin > 59)
                        {
-                               logit(LL_ERR, "ERROR parsing config file: invalid time [%s] at line %d!", *dt, lineno);
+                               logit(LL_ERR, "ERROR parsing config file: invalid time [%s] at line %d!", dt, lineno);
                                config_error_flag++;
                                return;
                        }
diff -r f8071eb3b55e -r d615ec36b27f usr.sbin/isdn/isdnd/support.c
--- a/usr.sbin/isdn/isdnd/support.c     Thu Mar 01 22:30:40 2012 +0000
+++ b/usr.sbin/isdn/isdnd/support.c     Thu Mar 01 22:31:48 2012 +0000
@@ -27,7 +27,7 @@
  *     i4b daemon - misc support routines
  *     ----------------------------------
  *
- *     $Id: support.c,v 1.15 2009/04/16 05:56:32 lukem Exp $ 
+ *     $Id: support.c,v 1.16 2012/03/01 22:31:48 joerg Exp $ 
  *
  * $FreeBSD$
  *
@@ -679,7 +679,7 @@
        {
                if (cep->aoc_diff != cep->unitlength)
                {
-                       DBGL(DL_MSG, (logit(LL_DBG, "handle_charge: AOCD unit length updated %d -> %d secs", cep->unitlength, cep->aoc_diff)));
+                       DBGL(DL_MSG, (logit(LL_DBG, "handle_charge: AOCD unit length updated %d -> %jd secs", cep->unitlength, (intmax_t)cep->aoc_diff)));
 
                        cep->unitlength = cep->aoc_diff;
 
diff -r f8071eb3b55e -r d615ec36b27f usr.sbin/isdn/isdnd/timer.c
--- a/usr.sbin/isdn/isdnd/timer.c       Thu Mar 01 22:30:40 2012 +0000
+++ b/usr.sbin/isdn/isdnd/timer.c       Thu Mar 01 22:31:48 2012 +0000
@@ -27,7 +27,7 @@
  *     i4b daemon - timer/timing support routines
  *     ------------------------------------------
  *
- *     $Id: timer.c,v 1.4 2003/10/06 09:43:27 itojun Exp $ 
+ *     $Id: timer.c,v 1.5 2012/03/01 22:31:48 joerg Exp $ 
  *
  * $FreeBSD$
  *
@@ -96,25 +96,25 @@
        if ((tv_now.tv_sec - tv_last.tv_sec) < 1)
        {
        
-               DBGL(DL_TIME, (logit(LL_DBG, "time < 1 - last %ld:%ld now %ld:%ld",
-                               tv_last.tv_sec, tv_last.tv_usec,
-                               tv_now.tv_sec, tv_now.tv_usec)));
+               DBGL(DL_TIME, (logit(LL_DBG, "time < 1 - last %jd:%ld now %jd:%ld",
+                               (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+                               (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
                return(1);
        }
        else if ((tv_now.tv_sec - tv_last.tv_sec) == 1)
        {
                if (((1000000 - tv_last.tv_usec) + tv_now.tv_usec) < 900000)
                {
-                       DBGL(DL_TIME, (logit(LL_DBG, "time < 900000us - last %ld:%ld now %ld:%ld",
-                                       tv_last.tv_sec, tv_last.tv_usec,
-                                       tv_now.tv_sec, tv_now.tv_usec)));
+                       DBGL(DL_TIME, (logit(LL_DBG, "time < 900000us - last %jd:%ld now %jd:%ld",
+                                       (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+                                       (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
                        return(1);
                }
        }
        
-       DBGL(DL_TIME, (logit(LL_DBG, "time OK! - last %ld:%ld now %ld:%ld",
-                       tv_last.tv_sec, tv_last.tv_usec,
-                       tv_now.tv_sec, tv_now.tv_usec)));
+       DBGL(DL_TIME, (logit(LL_DBG, "time OK! - last %jd:%ld now %jd:%ld",
+                       (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+                       (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
        
        gettimeofday(&tv_last, NULL);
        



Home | Main Index | Thread Index | Old Index