Ignore:
Timestamp:
Aug 14, 2017, 2:03:39 PM (7 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, resolv-new, with_gc
Children:
74b007ba
Parents:
fd344aa (diff), 54cd58b (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' into references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib.c

    rfd344aa r9236060  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  1 21:52:57 2017
    13 // Update Count     : 280
     12// Last Modified On : Tue Aug  8 17:31:13 2017
     13// Update Count     : 291
    1414//
    1515
     
    1818//---------------------------------------
    1919
    20 extern "C" {
    2120#define _XOPEN_SOURCE 600                                                               // posix_memalign, *rand48
    2221#include <stdlib.h>                                                                             // malloc, free, calloc, realloc, memalign, posix_memalign, bsearch
     
    2524#include <math.h>                                                                               // fabsf, fabs, fabsl
    2625#include <complex.h>                                                                    // _Complex_I
    27 } // extern "C"
    2826
    2927// resize, non-array types
     
    257255//---------------------------------------
    258256
     257[ int, int ] div( int num, int denom ) { div_t qr = div( num, denom ); return [ qr.quot, qr.rem ]; }
     258[ long int, long int ] div( long int num, long int denom ) { ldiv_t qr = ldiv( num, denom ); return [ qr.quot, qr.rem ]; }
     259[ long long int, long long int ] div( long long int num, long long int denom ) { lldiv_t qr = lldiv( num, denom ); return [ qr.quot, qr.rem ]; }
    259260forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    260 [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; }
     261[ T, T ] div( T num, T denom ) { return [ num / denom, num % denom ]; }
    261262
    262263//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.