- Timestamp:
- Apr 16, 2017, 9:16:18 PM (8 years ago)
- 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:
- 33e22da
- Parents:
- 19b2133
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/Makefile.in
r19b2133 r02d241f 99 99 am__libcfa_d_a_SOURCES_DIST = libcfa-prelude.c interpose.c \ 100 100 libhdr/libdebug.c limits.c stdlib.c math.c iostream.c \ 101 fstream.c iterator.c rational.c assert.c containers/vector.c \ 102 concurrency/coroutine.c concurrency/thread.c \ 103 concurrency/kernel.c concurrency/monitor.c \ 104 concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/invoke.c 101 fstream.c iterator.c rational.c assert.c containers/pair.c \ 102 containers/vector.c concurrency/coroutine.c \ 103 concurrency/thread.c concurrency/kernel.c \ 104 concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 105 concurrency/invoke.c 105 106 am__dirstamp = $(am__leading_dot)dirstamp 106 107 @BUILD_CONCURRENCY_TRUE@am__objects_1 = concurrency/libcfa_d_a-coroutine.$(OBJEXT) \ … … 113 114 libcfa_d_a-iterator.$(OBJEXT) libcfa_d_a-rational.$(OBJEXT) \ 114 115 libcfa_d_a-assert.$(OBJEXT) \ 116 containers/libcfa_d_a-pair.$(OBJEXT) \ 115 117 containers/libcfa_d_a-vector.$(OBJEXT) $(am__objects_1) 116 118 @BUILD_CONCURRENCY_TRUE@am__objects_3 = concurrency/CtxSwitch-@MACHINE_TYPE@.$(OBJEXT) \ … … 126 128 am__libcfa_a_SOURCES_DIST = libcfa-prelude.c interpose.c \ 127 129 libhdr/libdebug.c limits.c stdlib.c math.c iostream.c \ 128 fstream.c iterator.c rational.c assert.c containers/vector.c \ 129 concurrency/coroutine.c concurrency/thread.c \ 130 concurrency/kernel.c concurrency/monitor.c \ 131 concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/invoke.c 130 fstream.c iterator.c rational.c assert.c containers/pair.c \ 131 containers/vector.c concurrency/coroutine.c \ 132 concurrency/thread.c concurrency/kernel.c \ 133 concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 134 concurrency/invoke.c 132 135 @BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \ 133 136 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-thread.$(OBJEXT) \ … … 138 141 libcfa_a-fstream.$(OBJEXT) libcfa_a-iterator.$(OBJEXT) \ 139 142 libcfa_a-rational.$(OBJEXT) libcfa_a-assert.$(OBJEXT) \ 143 containers/libcfa_a-pair.$(OBJEXT) \ 140 144 containers/libcfa_a-vector.$(OBJEXT) $(am__objects_5) 141 145 @BUILD_CONCURRENCY_TRUE@am__objects_7 = concurrency/CtxSwitch-@MACHINE_TYPE@.$(OBJEXT) \ … … 176 180 $(am__libcfa_a_SOURCES_DIST) 177 181 am__nobase_cfa_include_HEADERS_DIST = limits stdlib math iostream \ 178 fstream iterator rational assert containers/ vector \179 con currency/coroutine concurrency/thread concurrency/kernel\180 concurrency/ monitor ${shell echo stdhdr/*} \182 fstream iterator rational assert containers/pair \ 183 containers/vector concurrency/coroutine concurrency/thread \ 184 concurrency/kernel concurrency/monitor ${shell echo stdhdr/*} \ 181 185 concurrency/invoke.h 182 186 HEADERS = $(nobase_cfa_include_HEADERS) … … 310 314 AM_CCASFLAGS = @CFA_FLAGS@ 311 315 headers = limits stdlib math iostream fstream iterator rational assert \ 312 containers/ vector $(am__append_3)316 containers/pair containers/vector $(am__append_3) 313 317 libobjs = ${headers:=.o} 314 318 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ … … 400 404 @$(MKDIR_P) containers/$(DEPDIR) 401 405 @: > containers/$(DEPDIR)/$(am__dirstamp) 406 containers/libcfa_d_a-pair.$(OBJEXT): containers/$(am__dirstamp) \ 407 containers/$(DEPDIR)/$(am__dirstamp) 402 408 containers/libcfa_d_a-vector.$(OBJEXT): containers/$(am__dirstamp) \ 403 409 containers/$(DEPDIR)/$(am__dirstamp) … … 428 434 libhdr/libcfa_a-libdebug.$(OBJEXT): libhdr/$(am__dirstamp) \ 429 435 libhdr/$(DEPDIR)/$(am__dirstamp) 436 containers/libcfa_a-pair.$(OBJEXT): containers/$(am__dirstamp) \ 437 containers/$(DEPDIR)/$(am__dirstamp) 430 438 containers/libcfa_a-vector.$(OBJEXT): containers/$(am__dirstamp) \ 431 439 containers/$(DEPDIR)/$(am__dirstamp) … … 458 466 -rm -f concurrency/libcfa_d_a-monitor.$(OBJEXT) 459 467 -rm -f concurrency/libcfa_d_a-thread.$(OBJEXT) 468 -rm -f containers/libcfa_a-pair.$(OBJEXT) 460 469 -rm -f containers/libcfa_a-vector.$(OBJEXT) 470 -rm -f containers/libcfa_d_a-pair.$(OBJEXT) 461 471 -rm -f containers/libcfa_d_a-vector.$(OBJEXT) 462 472 -rm -f libhdr/libcfa_a-libdebug.$(OBJEXT) … … 497 507 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-monitor.Po@am__quote@ 498 508 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-thread.Po@am__quote@ 509 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_a-pair.Po@am__quote@ 499 510 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_a-vector.Po@am__quote@ 511 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-pair.Po@am__quote@ 500 512 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-vector.Po@am__quote@ 501 513 @AMDEP_TRUE@@am__include@ @am__quote@libhdr/$(DEPDIR)/libcfa_a-libdebug.Po@am__quote@ … … 681 693 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-assert.obj `if test -f 'assert.c'; then $(CYGPATH_W) 'assert.c'; else $(CYGPATH_W) '$(srcdir)/assert.c'; fi` 682 694 695 containers/libcfa_d_a-pair.o: containers/pair.c 696 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT containers/libcfa_d_a-pair.o -MD -MP -MF containers/$(DEPDIR)/libcfa_d_a-pair.Tpo -c -o containers/libcfa_d_a-pair.o `test -f 'containers/pair.c' || echo '$(srcdir)/'`containers/pair.c 697 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) containers/$(DEPDIR)/libcfa_d_a-pair.Tpo containers/$(DEPDIR)/libcfa_d_a-pair.Po 698 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='containers/pair.c' object='containers/libcfa_d_a-pair.o' libtool=no @AMDEPBACKSLASH@ 699 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 700 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_d_a-pair.o `test -f 'containers/pair.c' || echo '$(srcdir)/'`containers/pair.c 701 702 containers/libcfa_d_a-pair.obj: containers/pair.c 703 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT containers/libcfa_d_a-pair.obj -MD -MP -MF containers/$(DEPDIR)/libcfa_d_a-pair.Tpo -c -o containers/libcfa_d_a-pair.obj `if test -f 'containers/pair.c'; then $(CYGPATH_W) 'containers/pair.c'; else $(CYGPATH_W) '$(srcdir)/containers/pair.c'; fi` 704 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) containers/$(DEPDIR)/libcfa_d_a-pair.Tpo containers/$(DEPDIR)/libcfa_d_a-pair.Po 705 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='containers/pair.c' object='containers/libcfa_d_a-pair.obj' libtool=no @AMDEPBACKSLASH@ 706 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 707 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_d_a-pair.obj `if test -f 'containers/pair.c'; then $(CYGPATH_W) 'containers/pair.c'; else $(CYGPATH_W) '$(srcdir)/containers/pair.c'; fi` 708 683 709 containers/libcfa_d_a-vector.o: containers/vector.c 684 710 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT containers/libcfa_d_a-vector.o -MD -MP -MF containers/$(DEPDIR)/libcfa_d_a-vector.Tpo -c -o containers/libcfa_d_a-vector.o `test -f 'containers/vector.c' || echo '$(srcdir)/'`containers/vector.c … … 904 930 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 905 931 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-assert.obj `if test -f 'assert.c'; then $(CYGPATH_W) 'assert.c'; else $(CYGPATH_W) '$(srcdir)/assert.c'; fi` 932 933 containers/libcfa_a-pair.o: containers/pair.c 934 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT containers/libcfa_a-pair.o -MD -MP -MF containers/$(DEPDIR)/libcfa_a-pair.Tpo -c -o containers/libcfa_a-pair.o `test -f 'containers/pair.c' || echo '$(srcdir)/'`containers/pair.c 935 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) containers/$(DEPDIR)/libcfa_a-pair.Tpo containers/$(DEPDIR)/libcfa_a-pair.Po 936 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='containers/pair.c' object='containers/libcfa_a-pair.o' libtool=no @AMDEPBACKSLASH@ 937 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 938 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_a-pair.o `test -f 'containers/pair.c' || echo '$(srcdir)/'`containers/pair.c 939 940 containers/libcfa_a-pair.obj: containers/pair.c 941 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT containers/libcfa_a-pair.obj -MD -MP -MF containers/$(DEPDIR)/libcfa_a-pair.Tpo -c -o containers/libcfa_a-pair.obj `if test -f 'containers/pair.c'; then $(CYGPATH_W) 'containers/pair.c'; else $(CYGPATH_W) '$(srcdir)/containers/pair.c'; fi` 942 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) containers/$(DEPDIR)/libcfa_a-pair.Tpo containers/$(DEPDIR)/libcfa_a-pair.Po 943 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='containers/pair.c' object='containers/libcfa_a-pair.obj' libtool=no @AMDEPBACKSLASH@ 944 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 945 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_a-pair.obj `if test -f 'containers/pair.c'; then $(CYGPATH_W) 'containers/pair.c'; else $(CYGPATH_W) '$(srcdir)/containers/pair.c'; fi` 906 946 907 947 containers/libcfa_a-vector.o: containers/vector.c -
src/libcfa/stdlib.c
r19b2133 r02d241f 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Apr 1 18:31:26201713 // Update Count : 18 112 // Last Modified On : Sun Apr 16 10:41:05 2017 13 // Update Count : 189 14 14 // 15 15 … … 78 78 } // posix_memalign 79 79 80 forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params); } )80 forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params ); } ) 81 81 T * new( Params p ) { 82 return ((T *)malloc()){ p };82 return ((T *)malloc()){ p }; 83 83 } 84 84 … … 229 229 forall( otype T | { int ?<?( T, T ); } ) 230 230 unsigned int bsearch( T key, const T * arr, size_t dimension ) { 231 int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; } 232 T *result = (T *)bsearch( &key, arr, dimension, sizeof(T), comp ); 231 T *result = bsearch( key, arr, dimension ); 233 232 return result ? result - arr : dimension; // pointer subtraction includes sizeof(T) 234 233 } // bsearch
Note: See TracChangeset
for help on using the changeset viewer.