Changeset 358cba0 for src/libcfa/time.c


Ignore:
Timestamp:
May 15, 2018, 4:17:15 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
2e5fa345
Parents:
7d0a3ba (diff), a61fa0bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/time.c

    r7d0a3ba r358cba0  
    1010// Created On       : Tue Mar 27 13:33:14 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 12 14:41:00 2018
    13 // Update Count     : 22
     12// Last Modified On : Sun May  6 22:26:00 2018
     13// Update Count     : 37
    1414//
    1515
     
    1717#include "iostream"
    1818#include <stdio.h>                                                                              // snprintf
     19#include <assert.h>
    1920
    2021static char * nanomsd( long int ns, char * buf ) {              // most significant digits
     
    8788        time_t s = tv / TIMEGRAN;
    8889        tm tm;
    89         gmtime_r( &s, &tm );
     90        gmtime_r( &s, &tm );                                                            // tm_mon <= 11, tm_mday <= 31
     91#if defined(__GNUC__) && __GNUC__ >= 7
     92#pragma GCC diagnostic push
     93#pragma GCC diagnostic ignored "-Wformat-truncation"
     94#endif
    9095        snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_year % 99, tm.tm_mon + 1, tm.tm_mday );
     96#if defined(__GNUC__) && __GNUC__ >= 7
     97#pragma GCC diagnostic pop
     98#endif
    9199        return buf;
    92100} // yy_mm_dd
     
    95103        time_t s = tv / TIMEGRAN;
    96104        tm tm;
    97         gmtime_r( &s, &tm );
     105        gmtime_r( &s, &tm );                                                            // tm_mon <= 11, tm_mday <= 31
     106#if defined(__GNUC__) && __GNUC__ >= 7
     107#pragma GCC diagnostic push
     108#pragma GCC diagnostic ignored "-Wformat-truncation"
     109#endif
    98110        snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mon + 1, tm.tm_mday, tm.tm_year % 99 );
     111#if defined(__GNUC__) && __GNUC__ >= 7
     112#pragma GCC diagnostic pop
     113#endif
    99114        return buf;
    100115} // mm_dd_yy
     
    103118        time_t s = tv / TIMEGRAN;
    104119        tm tm;
    105         gmtime_r( &s, &tm );
     120        gmtime_r( &s, &tm );                                                            // tm_mon <= 11, tm_mday <= 31
     121#if defined(__GNUC__) && __GNUC__ >= 7
     122#pragma GCC diagnostic push
     123#pragma GCC diagnostic ignored "-Wformat-truncation"
     124#endif
    106125        snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year % 99 );
     126#if defined(__GNUC__) && __GNUC__ >= 7
     127#pragma GCC diagnostic pop
     128#endif
    107129        return buf;
    108130} // dd_mm_yy
Note: See TracChangeset for help on using the changeset viewer.