Fix build warnings related to printf/scanf of tv_usec.
[asterisk/asterisk.git] / main / cdr.c
index b73f9ce..2ec6848 100644 (file)
@@ -1119,14 +1119,15 @@ static void cdr_object_finalize(struct cdr_object *cdr)
                }
        }
 
-       ast_debug(1, "Finalized CDR for %s - start %ld.%ld answer %ld.%ld end %ld.%ld dispo %s\n",
+       /* tv_usec is suseconds_t, which could be int or long */
+       ast_debug(1, "Finalized CDR for %s - start %ld.%06ld answer %ld.%06ld end %ld.%06ld dispo %s\n",
                        cdr->party_a.snapshot->name,
                        cdr->start.tv_sec,
-                       cdr->start.tv_usec,
+                       (long)cdr->start.tv_usec,
                        cdr->answer.tv_sec,
-                       cdr->answer.tv_usec,
+                       (long)cdr->answer.tv_usec,
                        cdr->end.tv_sec,
-                       cdr->end.tv_usec,
+                       (long)cdr->end.tv_usec,
                        ast_cdr_disp2str(cdr->disposition));
 }
 
@@ -1151,9 +1152,10 @@ static void cdr_object_check_party_a_answer(struct cdr_object *cdr) {
 
        if (cdr->party_a.snapshot->state == AST_STATE_UP && ast_tvzero(cdr->answer)) {
                cdr->answer = ast_tvnow();
-               CDR_DEBUG(mod_cfg, "%p - Set answered time to %ld.%ld\n", cdr,
+               /* tv_usec is suseconds_t, which could be int or long */
+               CDR_DEBUG(mod_cfg, "%p - Set answered time to %ld.%06ld\n", cdr,
                        cdr->answer.tv_sec,
-                       cdr->answer.tv_usec);
+                       (long)cdr->answer.tv_usec);
        }
 }