From 4f8946f3a7304fa6e202d1b04c4406e9cbacc9f2 Mon Sep 17 00:00:00 2001 From: aiq Date: Sun, 1 Sep 2024 23:35:49 +0200 Subject: [PATCH] refactor: use plural instead as Slice-suffix as default for slice types --- doc/clingo/container/CInt64Vec.adoc | 8 ++-- doc/clingo/container/map.adoc | 2 +- doc/clingo/lang/slice.adoc | 8 ++-- doc/clingo/type/double.adoc | 22 ++++----- doc/clingo/type/float.adoc | 22 ++++----- doc/clingo/type/int16.adoc | 40 ++++++++-------- doc/clingo/type/int32.adoc | 46 +++++++++---------- doc/clingo/type/int64.adoc | 46 +++++++++---------- doc/clingo/type/int8.adoc | 40 ++++++++-------- doc/clingo/type/uint16.adoc | 40 ++++++++-------- doc/clingo/type/uint32.adoc | 40 ++++++++-------- doc/clingo/type/uint64.adoc | 40 ++++++++-------- doc/clingo/type/uint8.adoc | 40 ++++++++-------- inc/clingo/container/CInt64Vec.h | 8 ++-- inc/clingo/container/map.h | 2 +- inc/clingo/type/double.h | 22 ++++++--- inc/clingo/type/float.h | 22 ++++++--- inc/clingo/type/int16.h | 26 +++++------ inc/clingo/type/int32.h | 32 ++++++------- inc/clingo/type/int64.h | 32 ++++++------- inc/clingo/type/int8.h | 26 +++++------ inc/clingo/type/uint16.h | 26 +++++------ inc/clingo/type/uint32.h | 26 +++++------ inc/clingo/type/uint64.h | 26 +++++------ inc/clingo/type/uint8.h | 24 +++++----- src/clingo/color/cColor.c | 6 +-- src/clingo/container/CInt64Vec.c | 6 +-- src/clingo/container/map.c | 2 +- src/clingo/time/c_Month.c | 6 +-- src/clingo/type/double.c | 23 ++++++++-- src/clingo/type/float.c | 22 +++++++-- src/clingo/type/int16.c | 28 +++++------ src/clingo/type/int32.c | 34 +++++++------- src/clingo/type/int64.c | 34 +++++++------- src/clingo/type/int8.c | 28 +++++------ src/clingo/type/uint16.c | 28 +++++------ src/clingo/type/uint32.c | 28 +++++------ src/clingo/type/uint64.c | 28 +++++------ src/clingo/type/uint8.c | 28 +++++------ test/_/algo/sum.c | 2 +- .../container/CInt64Vec/CInt64Vec-overview.c | 2 +- test/clingo/container/map/benchmark-map.c | 2 +- test/clingo/lang/algo/BSEARCH.c | 4 +- test/clingo/lang/algo/FIND_MAX.c | 2 +- test/clingo/lang/algo/FIND_MIN.c | 2 +- test/clingo/lang/slice/left.c | 8 ++-- test/clingo/lang/slice/mid.c | 8 ++-- test/clingo/lang/slice/right.c | 8 ++-- test/clingo/lang/slice/scalars.c | 4 +- test/clingo/lang/slice/set_if.c | 6 +-- test/clingo/lang/slice/sub.c | 10 ++-- 51 files changed, 533 insertions(+), 492 deletions(-) diff --git a/doc/clingo/container/CInt64Vec.adoc b/doc/clingo/container/CInt64Vec.adoc index 2751841..3b8dd68 100644 --- a/doc/clingo/container/CInt64Vec.adoc +++ b/doc/clingo/container/CInt64Vec.adoc @@ -43,9 +43,9 @@ include::{docroot}/clingo/_tmpl/ValVec.adoc[] ---- #define add_many_to_int64_vec_c_( Vec, ... ) \ add_many_to_int64_vec_c( \ - (Vec), (cInt64Slice)slice_c_( int64_t, __VA_ARGS__ ) \ + (Vec), (cInt64s)slice_c_( int64_t, __VA_ARGS__ ) \ ) -bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64Slice many ); +bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64s many ); ---- Adds all int64_t values from the slice to the int64_t vector. @@ -53,7 +53,7 @@ Adds all int64_t values from the slice to the int64_t vector. ==== slice_of_int64_vec_c [source,c] ---- -cInt64Slice slice_of_int64_vec_c( CInt64Vec const* vec ); +cInt64s slice_of_int64_vec_c( CInt64Vec const* vec ); ---- Via the macro link:vec.html#SLICE_OF_VEC_C_[SLICE_OF_VEC_C_] implemented function. @@ -61,7 +61,7 @@ Via the macro link:vec.html#SLICE_OF_VEC_C_[SLICE_OF_VEC_C_] implemented functio ==== var_slice_of_int64_vec_c [source,c] ---- -cVarInt64Slice var_slice_of_int64_vec_c( CInt64Vec* vec ); +cVarInt64s var_slice_of_int64_vec_c( CInt64Vec* vec ); ---- Via the macro link:vec.html#VAR_SLICE_OF_VEC_C_[VAR_SLICE_OF_VEC_C_] implemented function. \ No newline at end of file diff --git a/doc/clingo/container/map.adoc b/doc/clingo/container/map.adoc index 2cb4f37..38a4981 100644 --- a/doc/clingo/container/map.adoc +++ b/doc/clingo/container/map.adoc @@ -478,7 +478,7 @@ Fibonacci Hash function. ==== combine_hashes_c [source,c] ---- -uint64_t combine_hashes_c( cUint64Slice hashes ); +uint64_t combine_hashes_c( cUint64s hashes ); ---- Combines single hash values to one hash value. diff --git a/doc/clingo/lang/slice.adoc b/doc/clingo/lang/slice.adoc index a547c33..29d6538 100644 --- a/doc/clingo/lang/slice.adoc +++ b/doc/clingo/lang/slice.adoc @@ -31,8 +31,8 @@ to variable data. | cVarChars | int8_t -| cInt8Slice -| cVarInt8Slice +| cInt8s +| cVarInt8s |==== This module defines code generation macros to generate typed slice structs. @@ -64,8 +64,8 @@ The following call can be used in a .h or .c file. ---- SLICES_C_( int8_t, // Type - cInt8Slice, // SliceType - cVarInt8Slice // VarSliceType + cInt8s, // SliceType + cVarInt8s // VarSliceType ) ---- diff --git a/doc/clingo/type/double.adoc b/doc/clingo/type/double.adoc index d44ed8c..b753b20 100644 --- a/doc/clingo/type/double.adoc +++ b/doc/clingo/type/double.adoc @@ -33,16 +33,16 @@ cDoubleInfo represents the three sections of a double value. //******************************************************************* Generated === Generated -[id='cDoubleSlice'] -==== cDoubleSlice +[id='cDoubles'] +==== cDoubles :Slice-Type: double const -:Slice-Slice: cDoubleSlice +:Slice-Slice: cDoubles include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarDoubleSlice'] -==== cVarDoubleSlice +[id='cVarDoubles'] +==== cVarDoubles :Slice-Type: double -:Slice-Slice: cVarDoubleSlice +:Slice-Slice: cVarDoubles include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -207,7 +207,7 @@ include::{xmpldir}/unpack_double.c[] ==== find_double_c [source,c] ---- -double const* find_double_c( cDoubleSlice slice, double d ); +double const* find_double_c( cDoubles slice, double d ); ---- {FindVal} @@ -215,7 +215,7 @@ double const* find_double_c( cDoubleSlice slice, double d ); ==== max_double_c [source,c] ---- -double const* max_double_c( cDoubleSlice slice ); +double const* max_double_c( cDoubles slice ); ---- {FindMax} @@ -223,7 +223,7 @@ double const* max_double_c( cDoubleSlice slice ); ==== min_double_c [source,c] ---- -double const* min_double_c( cDoubleSlice slice ); +double const* min_double_c( cDoubles slice ); ---- {FindMin} @@ -231,7 +231,7 @@ double const* min_double_c( cDoubleSlice slice ); ==== prod_double_c [source,c] ---- -bool prod_double_c( cDoubleSlice slice, double res[static 1] ); +bool prod_double_c( cDoubles slice, double res[static 1] ); ---- {Prod} @@ -239,7 +239,7 @@ bool prod_double_c( cDoubleSlice slice, double res[static 1] ); ==== sum_double_c [source,c] ---- -bool sum_double_c( cDoubleSlice slice, double res[static 1] ); +bool sum_double_c( cDoubles slice, double res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/float.adoc b/doc/clingo/type/float.adoc index 1662515..093a240 100644 --- a/doc/clingo/type/float.adoc +++ b/doc/clingo/type/float.adoc @@ -33,16 +33,16 @@ cFloatInfo represents the three sections of a float value. //******************************************************************* Generated === Generated -[id='cFloatSlice'] -==== cFloatSlice +[id='cFloats'] +==== cFloats :Slice-Type: float const -:Slice-Slice: cFloatSlice +:Slice-Slice: cFloats include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarFloatSlice'] -==== cVarFloatSlice +[id='cVarFloats'] +==== cVarFloats :Slice-Type: float -:Slice-Slice: cVarFloatSlice +:Slice-Slice: cVarFloats include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -191,7 +191,7 @@ include::{xmpldir}/unpack_float.c[] ==== find_float_c [source,c] ---- -float const* find_float_c( cFloatSlice slice, float f ); +float const* find_float_c( cFloats slice, float f ); ---- {FindVal} @@ -199,7 +199,7 @@ float const* find_float_c( cFloatSlice slice, float f ); ==== max_float_c [source,c] ---- -float const* max_float_c( cFloatSlice slice ); +float const* max_float_c( cFloats slice ); ---- {FindMax} @@ -207,7 +207,7 @@ float const* max_float_c( cFloatSlice slice ); ==== min_float_c [source,c] ---- -float const* min_float_c( cFloatSlice slice ); +float const* min_float_c( cFloats slice ); ---- {FindMin} @@ -215,7 +215,7 @@ float const* min_float_c( cFloatSlice slice ); ==== prod_float_c [source,c] ---- -bool prod_float_c( cFloatSlice slice, float res[static 1] ); +bool prod_float_c( cFloats slice, float res[static 1] ); ---- {Prod} @@ -223,7 +223,7 @@ bool prod_float_c( cFloatSlice slice, float res[static 1] ); ==== sum_float_c [source,c] ---- -bool sum_float_c( cFloatSlice slice, float res[static 1] ); +bool sum_float_c( cFloats slice, float res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/int16.adoc b/doc/clingo/type/int16.adoc index 01782a4..bf0451a 100644 --- a/doc/clingo/type/int16.adoc +++ b/doc/clingo/type/int16.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with int16_t values. //******************************************************************* Generated === Generated -[id='cInt16Slice'] -==== cInt16Slice +[id='cInt16s'] +==== cInt16s :Slice-Type: int16_t const -:Slice-Slice: cInt16Slice +:Slice-Slice: cInt16s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarInt16Slice'] -==== cVarInt16Slice +[id='cVarInt16s'] +==== cVarInt16s :Slice-Type: int16_t -:Slice-Slice: cVarInt16Slice +:Slice-Slice: cVarInt16s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -148,10 +148,10 @@ include::{xmpldir}/swap_int16_to.c[] //************************************************************************ algo === algo -==== cmp_int16_slice_c +==== cmp_int16s_c [source,c] ---- -int cmp_int16_slice_c( cInt16Slice a, cInt16Slice b ); +int cmp_int16s_c( cInt16s a, cInt16s b ); ---- {CmpSlice} @@ -159,7 +159,7 @@ int cmp_int16_slice_c( cInt16Slice a, cInt16Slice b ); ==== count_eq_int16_c [source,c] ---- -int64_t count_eq_int16_c( cInt16Slice slice, int16_t val ); +int64_t count_eq_int16_c( cInt16s slice, int16_t val ); ---- {CountEq} @@ -167,7 +167,7 @@ int64_t count_eq_int16_c( cInt16Slice slice, int16_t val ); ==== find_int16_c [source,c] ---- -int16_t const* find_int16_c( cInt16Slice slice, int16_t val ); +int16_t const* find_int16_c( cInt16s slice, int16_t val ); ---- {FindVal} @@ -175,7 +175,7 @@ int16_t const* find_int16_c( cInt16Slice slice, int16_t val ); ==== max_int16_c [source,c] ---- -int16_t const* max_int16_c( cInt16Slice slice ); +int16_t const* max_int16_c( cInt16s slice ); ---- {FindMax} @@ -183,7 +183,7 @@ int16_t const* max_int16_c( cInt16Slice slice ); ==== min_int16_c [source,c] ---- -int16_t const* min_int16_c( cInt16Slice slice ); +int16_t const* min_int16_c( cInt16s slice ); ---- {FindMin} @@ -191,31 +191,31 @@ int16_t const* min_int16_c( cInt16Slice slice ); ==== prod_int16_c [source,c] ---- -bool prod_int16_c( cInt16Slice slice, int64_t res[static 1] ); +bool prod_int16_c( cInt16s slice, int64_t res[static 1] ); ---- {Prod} -==== qsort_int16_slice_c +==== qsort_int16s_c [source,c] ---- -void qsort_int16_slice_c( cVarInt16Slice slice ); +void qsort_int16s_c( cVarInt16s slice ); ---- {Qsort} -==== reverse_int16_slice_c +==== reverse_int16s_c [source,c] ---- -void reverse_int16_slice_c( cVarInt16Slice slice ); +void reverse_int16s_c( cVarInt16s slice ); ---- {Reverse} -==== rotate_int16_slice_c +==== rotate_int16s_c [source,c] ---- -void rotate_int16_slice_c( cVarInt16Slice slice, int64_t distance ); +void rotate_int16s_c( cVarInt16s slice, int64_t distance ); ---- {Rotate} @@ -223,7 +223,7 @@ void rotate_int16_slice_c( cVarInt16Slice slice, int64_t distance ); ==== sum_int16_c [source,c] ---- -bool sum_int16_c( cInt16Slice slice, int64_t res[static 1] ); +bool sum_int16_c( cInt16s slice, int64_t res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/int32.adoc b/doc/clingo/type/int32.adoc index e865e49..e37d574 100644 --- a/doc/clingo/type/int32.adoc +++ b/doc/clingo/type/int32.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with int32_t values. //******************************************************************* Generated === Generated -[id='cInt32Slice'] -==== cInt32Slice +[id='cInt32s'] +==== cInt32s :Slice-Type: int32_t const -:Slice-Slice: cInt32Slice +:Slice-Slice: cInt32s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarInt32Slice'] -==== cVarInt32Slice +[id='cVarInt32s'] +==== cVarInt32s :Slice-Type: int32_t -:Slice-Slice: cVarInt32Slice +:Slice-Slice: cVarInt32s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -151,15 +151,15 @@ include::{xmpldir}/swap_int32_to.c[] ==== bsearch_int32_c [source,c] ---- -int32_t const* bsearch_int32_c( cInt32Slice slice, int32_t val ); +int32_t const* bsearch_int32_c( cInt32s slice, int32_t val ); ---- {Bsearch} -==== cmp_int32_slice_c +==== cmp_int32s_c [source,c] ---- -int cmp_int32_slice_c( cInt32Slice a, cInt32Slice b ); +int cmp_int32s_c( cInt32s a, cInt32s b ); ---- {CmpSlice} @@ -167,7 +167,7 @@ int cmp_int32_slice_c( cInt32Slice a, cInt32Slice b ); ==== count_eq_int32_c [source,c] ---- -int64_t count_eq_int32_c( cInt32Slice slice, int32_t val ); +int64_t count_eq_int32_c( cInt32s slice, int32_t val ); ---- {CountEq} @@ -175,7 +175,7 @@ int64_t count_eq_int32_c( cInt32Slice slice, int32_t val ); ==== find_int32_c [source,c] ---- -int32_t const* find_int32_c( cInt32Slice slice, int32_t val ); +int32_t const* find_int32_c( cInt32s slice, int32_t val ); ---- {FindVal} @@ -183,7 +183,7 @@ int32_t const* find_int32_c( cInt32Slice slice, int32_t val ); ==== max_int32_c [source,c] ---- -int32_t const* max_int32_c( cInt32Slice slice ); +int32_t const* max_int32_c( cInt32s slice ); ---- {FindMax} @@ -191,7 +191,7 @@ int32_t const* max_int32_c( cInt32Slice slice ); ==== min_int32_c [source,c] ---- -int32_t const* min_int32_c( cInt32Slice slice ); +int32_t const* min_int32_c( cInt32s slice ); ---- {FindMin} @@ -199,15 +199,15 @@ int32_t const* min_int32_c( cInt32Slice slice ); ==== prod_int32_c [source,c] ---- -bool prod_int32_c( cInt32Slice slice, int64_t res[static 1] ); +bool prod_int32_c( cInt32s slice, int64_t res[static 1] ); ---- {Prod} -==== qsort_int32_slice_c +==== qsort_int32s_c [source,c] ---- -void qsort_int32_slice_c( cVarInt32Slice slice ); +void qsort_int32s_c( cVarInt32s slice ); ---- {Qsort} @@ -215,23 +215,23 @@ void qsort_int32_slice_c( cVarInt32Slice slice ); ==== remove_int32_c [source,c] ---- -bool remove_int32_c( cVarInt32Slice slice[static 1], int64_t pos ); +bool remove_int32_c( cVarInt32s slice[static 1], int64_t pos ); ---- {Remove} -==== reverse_int32_slice_c +==== reverse_int32s_c [source,c] ---- -void reverse_int32_slice_c( cVarInt32Slice slice ); +void reverse_int32s_c( cVarInt32s slice ); ---- {Reverse} -==== rotate_int32_slice_c +==== rotate_int32s_c [source,c] ---- -void rotate_int32_slice_c( cVarInt32Slice slice, int64_t distance ); +void rotate_int32s_c( cVarInt32s slice, int64_t distance ); ---- {Rotate} @@ -239,7 +239,7 @@ void rotate_int32_slice_c( cVarInt32Slice slice, int64_t distance ); ==== sum_int32_c [source,c] ---- -bool sum_int32_c( cInt32Slice slice, int64_t res[static 1] ); +bool sum_int32_c( cInt32s slice, int64_t res[static 1] ); ---- {Sum} @@ -247,7 +247,7 @@ bool sum_int32_c( cInt32Slice slice, int64_t res[static 1] ); ==== take_int64_c [source,c] ---- -bool take_int32_c( cVarInt32Slice slice[static 1], +bool take_int32_c( cVarInt32s slice[static 1], int64_t pos, int32_t val[static 1] ); ---- diff --git a/doc/clingo/type/int64.adoc b/doc/clingo/type/int64.adoc index 09faee8..deb1002 100644 --- a/doc/clingo/type/int64.adoc +++ b/doc/clingo/type/int64.adoc @@ -18,16 +18,16 @@ Modue with functions and types to work with int64_t values. //******************************************************************* Generated === Generated -[id='cInt64Slice'] -==== cInt64Slice +[id='cInt64s'] +==== cInt64s :Slice-Type: int64_t const -:Slice-Slice: cInt64Slice +:Slice-Slice: cInt64s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarInt64Slice'] -==== cVarInt64Slice +[id='cVarInt64s'] +==== cVarInt64s :Slice-Type: int64_t -:Slice-Slice: cVarInt64Slice +:Slice-Slice: cVarInt64s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -154,15 +154,15 @@ Returns the next power of two value. ==== bsearch_int64_c [source,c] ---- -int64_t const* bsearch_int64_c( cInt64Slice slice, int64_t val ); +int64_t const* bsearch_int64_c( cInt64s slice, int64_t val ); ---- {Bsearch} -==== cmp_int64_slice_c +==== cmp_int64s_c [source,c] ---- -int cmp_int64_slice_c( cInt64Slice a, cInt64Slice b ); +int cmp_int64s_c( cInt64s a, cInt64s b ); ---- {CmpSlice} @@ -170,7 +170,7 @@ int cmp_int64_slice_c( cInt64Slice a, cInt64Slice b ); ==== count_eq_int64_c [source,c] ---- -int64_t count_eq_int64_c( cInt64Slice slice, int64_t val ); +int64_t count_eq_int64_c( cInt64s slice, int64_t val ); ---- {CountEq} @@ -178,7 +178,7 @@ int64_t count_eq_int64_c( cInt64Slice slice, int64_t val ); ==== find_int64_c [source,c] ---- -int64_t const* find_int64_c( cInt64Slice slice, int64_t val ); +int64_t const* find_int64_c( cInt64s slice, int64_t val ); ---- {FindVal} @@ -186,7 +186,7 @@ int64_t const* find_int64_c( cInt64Slice slice, int64_t val ); ==== max_int64_c [source,c] ---- -int64_t const* max_int64_c( cInt64Slice slice ); +int64_t const* max_int64_c( cInt64s slice ); ---- {FindMax} @@ -194,7 +194,7 @@ int64_t const* max_int64_c( cInt64Slice slice ); ==== min_int64_c [source,c] ---- -int64_t const* min_int64_c( cInt64Slice slice ); +int64_t const* min_int64_c( cInt64s slice ); ---- {FindMin} @@ -202,15 +202,15 @@ int64_t const* min_int64_c( cInt64Slice slice ); ==== prod_int64_c [source,c] ---- -bool prod_int64_c( cInt64Slice slice, int64_t res[static 1] ); +bool prod_int64_c( cInt64s slice, int64_t res[static 1] ); ---- {Prod} -==== qsort_int64_slice_c +==== qsort_int64s_c [source,c] ---- -void qsort_int64_slice_c( cVarInt64Slice slice ); +void qsort_int64s_c( cVarInt64s slice ); ---- {Qsort} @@ -218,23 +218,23 @@ void qsort_int64_slice_c( cVarInt64Slice slice ); ==== remove_int64_c [source,c] ---- -bool remove_int64_c( cVarInt64Slice slice[static 1], int64_t pos); +bool remove_int64_c( cVarInt64s slice[static 1], int64_t pos); ---- {Remove} -==== reverse_int64_slice_c +==== reverse_int64s_c [source,c] ---- -void reverse_int64_slice_c( cVarInt64Slice slice ); +void reverse_int64s_c( cVarInt64s slice ); ---- {Reverse} -==== rotate_int64_slice_c +==== rotate_int64s_c [source,c] ---- -void rotate_int64_slice_c( cVarInt64Slice slice, int64_t distance ); +void rotate_int64s_c( cVarInt64s slice, int64_t distance ); ---- {Rotate} @@ -242,7 +242,7 @@ void rotate_int64_slice_c( cVarInt64Slice slice, int64_t distance ); ==== sum_int64_c [source,c] ---- -bool sum_int64_c( cInt64Slice slice, int64_t res[static 1] ); +bool sum_int64_c( cInt64s slice, int64_t res[static 1] ); ---- {Sum} @@ -250,7 +250,7 @@ bool sum_int64_c( cInt64Slice slice, int64_t res[static 1] ); ==== take_int64_c [source,c] ---- -bool take_int64_c( cVarInt64Slice slice[static 1], +bool take_int64_c( cVarInt64s slice[static 1], int64_t pos, int64_t val[static 1] ); ---- diff --git a/doc/clingo/type/int8.adoc b/doc/clingo/type/int8.adoc index b19619c..7aaacaa 100644 --- a/doc/clingo/type/int8.adoc +++ b/doc/clingo/type/int8.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with int8_t values. //******************************************************************* Generated === Generated -[id='cInt8Slice'] -==== cInt8Slice +[id='cInt8s'] +==== cInt8s :Slice-Type: int8_t const -:Slice-Slice: cInt8Slice +:Slice-Slice: cInt8s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarInt8Slice'] -==== cVarInt8Slice +[id='cVarInt8s'] +==== cVarInt8s :Slice-Type: int8_t -:Slice-Slice: cVarInt8Slice +:Slice-Slice: cVarInt8s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -103,10 +103,10 @@ include::{xmpldir}/uint64_to_int8.c[] //************************************************************************ algo === algo -==== cmp_int8_slice_c +==== cmp_int8s_c [source,c] ---- -int64_t cmp_int8_slice_c( cInt8Slice a, cInt8Slice b ); +int64_t cmp_int8s_c( cInt8s a, cInt8s b ); ---- {CmpSlice} @@ -114,7 +114,7 @@ int64_t cmp_int8_slice_c( cInt8Slice a, cInt8Slice b ); ==== count_eq_int8_c [source,c] ---- -int64_t count_eq_int8_c( cInt8Slice slice, int8_t val ); +int64_t count_eq_int8_c( cInt8s slice, int8_t val ); ---- {CountEq} @@ -122,7 +122,7 @@ int64_t count_eq_int8_c( cInt8Slice slice, int8_t val ); ==== find_int8_c [source,c] ---- -int8_t const* find_int8_c( cInt8Slice slice, int8_t val ); +int8_t const* find_int8_c( cInt8s slice, int8_t val ); ---- {FindVal} @@ -130,7 +130,7 @@ int8_t const* find_int8_c( cInt8Slice slice, int8_t val ); ==== max_int8_c [source,c] ---- -int8_t const* max_int8_c( cInt8Slice slice ); +int8_t const* max_int8_c( cInt8s slice ); ---- {FindMax} @@ -138,7 +138,7 @@ int8_t const* max_int8_c( cInt8Slice slice ); ==== min_int8_c [source,c] ---- -int8_t const* min_int8_c( cInt8Slice slice ); +int8_t const* min_int8_c( cInt8s slice ); ---- {FindMin} @@ -146,31 +146,31 @@ int8_t const* min_int8_c( cInt8Slice slice ); ==== prod_int8_c [source,c] ---- -bool prod_int8_c( cInt8Slice slice, int64_t res [static 1] ); +bool prod_int8_c( cInt8s slice, int64_t res [static 1] ); ---- {Prod} -==== qsort_int8_slice_c +==== qsort_int8s_c [source,c] ---- -void qsort_int8_slice_c( cVarInt8Slice slice ); +void qsort_int8s_c( cVarInt8s slice ); ---- {Qsort} -==== reverse_int8_slice_c +==== reverse_int8s_c [source,c] ---- -void reverse_int8_slice_c( cVarInt8Slice slice ); +void reverse_int8s_c( cVarInt8s slice ); ---- {Reverse} -==== rotate_int8_slice_c +==== rotate_int8s_c [source,c] ---- -void rotate_var_int8_slice_c( cVarInt8Slice slice, int64_t distance ); +void rotate_var_int8s_c( cVarInt8s slice, int64_t distance ); ---- {Rotate} @@ -178,7 +178,7 @@ void rotate_var_int8_slice_c( cVarInt8Slice slice, int64_t distance ); ==== sum_int8_c [source,c] ---- -bool sum_int8_c( cInt8Slice slice, int64_t res[static 1] ); +bool sum_int8_c( cInt8s slice, int64_t res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/uint16.adoc b/doc/clingo/type/uint16.adoc index 8d7b346..fa5f35d 100644 --- a/doc/clingo/type/uint16.adoc +++ b/doc/clingo/type/uint16.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with uint16_t values. //******************************************************************* Generated === Generated -[id='cUint16Slice'] -==== cUint16Slice +[id='cUint16s'] +==== cUint16s :Slice-Type: uint16_t const -:Slice-Slice: cUint16Slice +:Slice-Slice: cUint16s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarUint16Slice'] -==== cVarUint16Slice +[id='cVarUint16s'] +==== cVarUint16s :Slice-Type: uint16_t -:Slice-Slice: cVarUint16Slice +:Slice-Slice: cVarUint16s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -148,10 +148,10 @@ include::{xmpldir}/swap_uint16_to.c[] //************************************************************************ algo === algo -==== cmp_uint16_slice_c +==== cmp_uint16s_c [source,c] ---- -int cmp_uint16_slice_c( cUint16Slice a, cUint16Slice b ); +int cmp_uint16s_c( cUint16s a, cUint16s b ); ---- {CmpSlice} @@ -159,7 +159,7 @@ int cmp_uint16_slice_c( cUint16Slice a, cUint16Slice b ); ==== count_eq_uint16_c [source,c] ---- -int64_t count_eq_uint16_c( cUint16Slice slice, uint16_t val ); +int64_t count_eq_uint16_c( cUint16s slice, uint16_t val ); ---- {CountEq} @@ -167,7 +167,7 @@ int64_t count_eq_uint16_c( cUint16Slice slice, uint16_t val ); ==== find_uint16_c [source,c] ---- -uint16_t const* find_uint16_c( cUint16Slice slice, uint16_t val ); +uint16_t const* find_uint16_c( cUint16s slice, uint16_t val ); ---- {FindVal} @@ -175,7 +175,7 @@ uint16_t const* find_uint16_c( cUint16Slice slice, uint16_t val ); ==== max_uint16_c [source,c] ---- -uint16_t const* max_uint16_c( cUint16Slice slice ); +uint16_t const* max_uint16_c( cUint16s slice ); ---- {FindMax} @@ -183,7 +183,7 @@ uint16_t const* max_uint16_c( cUint16Slice slice ); ==== min_uint16_c [source,c] ---- -uint16_t const* min_uint16_c( cUint16Slice slice ); +uint16_t const* min_uint16_c( cUint16s slice ); ---- {FindMin} @@ -191,31 +191,31 @@ uint16_t const* min_uint16_c( cUint16Slice slice ); ==== prod_uint16_c [source,c] ---- -bool prod_uint16_c( cUint16Slice slice, uint64_t res[static 1] ); +bool prod_uint16_c( cUint16s slice, uint64_t res[static 1] ); ---- {Prod} -==== qsort_uint16_slice_c +==== qsort_uint16s_c [source,c] ---- -void qsort_uint16_slice_c( cVarUint16Slice slice ); +void qsort_uint16s_c( cVarUint16s slice ); ---- {Qsort} -==== reverse_uint16_slice_c +==== reverse_uint16s_c [source,c] ---- -void reverse_uint16_slice_c( cVarUint16Slice slice ); +void reverse_uint16s_c( cVarUint16s slice ); ---- {Reverse} -==== rotate_uint16_slice_c +==== rotate_uint16s_c [source,c] ---- -void rotate_uint16_slice_c( cVarUint16Slice slice, int64_t distance ); +void rotate_uint16s_c( cVarUint16s slice, int64_t distance ); ---- {Rotate} @@ -223,7 +223,7 @@ void rotate_uint16_slice_c( cVarUint16Slice slice, int64_t distance ); ==== sum_uint16_c [source,c] ---- -bool sum_uint16_c( cUint16Slice slice, uint64_t res[static 1] ); +bool sum_uint16_c( cUint16s slice, uint64_t res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/uint32.adoc b/doc/clingo/type/uint32.adoc index 2ee97be..c1fbc9f 100644 --- a/doc/clingo/type/uint32.adoc +++ b/doc/clingo/type/uint32.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with uint32_t values. //******************************************************************* Generated === Generated -[id='cUint32Slice'] -==== cUint32Slice +[id='cUint32s'] +==== cUint32s :Slice-Type: uint32_t const -:Slice-Slice: cUint32Slice +:Slice-Slice: cUint32s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarUint32Slice'] -==== cVarUint32Slice +[id='cVarUint32s'] +==== cVarUint32s :Slice-Type: uint32_t -:Slice-Slice: cVarUint32Slice +:Slice-Slice: cVarUint32s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -165,10 +165,10 @@ include::{xmpldir}/next_pow2_uint32.c[] //************************************************************************ algo === algo -==== cmp_uint32_slice_c +==== cmp_uint32s_c [source,c] ---- -int cmp_uint32_slice_c( cUint32Slice a, cUint32Slice b ); +int cmp_uint32s_c( cUint32s a, cUint32s b ); ---- {CmpSlice} @@ -176,7 +176,7 @@ int cmp_uint32_slice_c( cUint32Slice a, cUint32Slice b ); ==== count_eq_uint32_c [source,c] ---- -int64_t count_eq_uint32_c( cUint32Slice slice, uint32_t val ); +int64_t count_eq_uint32_c( cUint32s slice, uint32_t val ); ---- {CountEq} @@ -184,7 +184,7 @@ int64_t count_eq_uint32_c( cUint32Slice slice, uint32_t val ); ==== find_uint32_c [source,c] ---- -uint32_t const* find_uint32_c( cUint32Slice slice, uint32_t val ); +uint32_t const* find_uint32_c( cUint32s slice, uint32_t val ); ---- {FindVal} @@ -192,7 +192,7 @@ uint32_t const* find_uint32_c( cUint32Slice slice, uint32_t val ); ==== max_uint32_c [source,c] ---- -uint32_t const* max_uint32_c( cUint32Slice slice ); +uint32_t const* max_uint32_c( cUint32s slice ); ---- {FindMax} @@ -200,7 +200,7 @@ uint32_t const* max_uint32_c( cUint32Slice slice ); ==== min_uint32_c [source,c] ---- -uint32_t const* min_uint32_c( cUint32Slice slice ); +uint32_t const* min_uint32_c( cUint32s slice ); ---- {FindMin} @@ -208,31 +208,31 @@ uint32_t const* min_uint32_c( cUint32Slice slice ); ==== prod_uint32_c [source,c] ---- -bool prod_uint32_c( cUint32Slice slice, uint64_t res[static 1] ); +bool prod_uint32_c( cUint32s slice, uint64_t res[static 1] ); ---- {Prod} -==== qsort_uint32_slice_c +==== qsort_uint32s_c [source,c] ---- -void qsort_uint32_slice_c( cVarUint32Slice slice ); +void qsort_uint32s_c( cVarUint32s slice ); ---- {Qsort} -==== reverse_uint32_slice_c +==== reverse_uint32s_c [source,c] ---- -void reverse_uint32_slice_c( cVarUint32Slice slice ); +void reverse_uint32s_c( cVarUint32s slice ); ---- {Reverse} -==== rotate_uint32_slice_c +==== rotate_uint32s_c [source,c] ---- -void rotate_uint32_slice_c( cVarUint32Slice slice, int64_t distance ); +void rotate_uint32s_c( cVarUint32s slice, int64_t distance ); ---- {Rotate} @@ -240,7 +240,7 @@ void rotate_uint32_slice_c( cVarUint32Slice slice, int64_t distance ); ==== sum_uint32_c [source,c] ---- -bool sum_uint32_c( cUint32Slice slice, uint64_t res[static 1] ); +bool sum_uint32_c( cUint32s slice, uint64_t res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/uint64.adoc b/doc/clingo/type/uint64.adoc index d5f3a50..5215e2a 100644 --- a/doc/clingo/type/uint64.adoc +++ b/doc/clingo/type/uint64.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with uint64_t values. //******************************************************************* Generated === Generated -[id='cUint64Slice'] -==== cUint64Slice +[id='cUint64s'] +==== cUint64s :Slice-Type: uint64_t const -:Slice-Slice: cUint64Slice +:Slice-Slice: cUint64s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarUint64Slice'] -==== cVarUint64Slice +[id='cVarUint64s'] +==== cVarUint64s :Slice-Type: uint64_t -:Slice-Slice: cVarUint64Slice +:Slice-Slice: cVarUint64s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -192,10 +192,10 @@ include::{xmpldir}/log2_uint64.c[] //************************************************************************ algo === algo -==== cmp_uint64_slice_c +==== cmp_uint64s_c [source,c] ---- -int cmp_uint64_slice_c( cUint64Slice a, cUint64Slice b ); +int cmp_uint64s_c( cUint64s a, cUint64s b ); ---- {CmpSlice} @@ -203,7 +203,7 @@ int cmp_uint64_slice_c( cUint64Slice a, cUint64Slice b ); ==== count_eq_uint64_c [source,c] ---- -int64_t count_eq_uint64_c( cUint64Slice slice, uint64_t val ); +int64_t count_eq_uint64_c( cUint64s slice, uint64_t val ); ---- {CountEq} @@ -211,7 +211,7 @@ int64_t count_eq_uint64_c( cUint64Slice slice, uint64_t val ); ==== find_uint64_c [source,c] ---- -uint64_t const* find_uint64_c( cUint64Slice slice, uint64_t val ); +uint64_t const* find_uint64_c( cUint64s slice, uint64_t val ); ---- {FindVal} @@ -219,7 +219,7 @@ uint64_t const* find_uint64_c( cUint64Slice slice, uint64_t val ); ==== max_uint64_c [source,c] ---- -uint64_t const* max_uint64_c( cUint64Slice slice ); +uint64_t const* max_uint64_c( cUint64s slice ); ---- {FindMax} @@ -227,7 +227,7 @@ uint64_t const* max_uint64_c( cUint64Slice slice ); ==== min_uint64_c [source,c] ---- -uint64_t const* min_uint64_c( cUint64Slice slice ); +uint64_t const* min_uint64_c( cUint64s slice ); ---- {FindMin} @@ -235,31 +235,31 @@ uint64_t const* min_uint64_c( cUint64Slice slice ); ==== prod_uint64_c [source,c] ---- -bool prod_uint64_c( cUint64Slice slice, uint64_t res[static 1] ); +bool prod_uint64_c( cUint64s slice, uint64_t res[static 1] ); ---- {Prod} -==== qsort_uint64_slice_c +==== qsort_uint64s_c [source,c] ---- -void qsort_uint64_slice_c( cVarUint64Slice slice ); +void qsort_uint64s_c( cVarUint64s slice ); ---- {Qsort} -==== reverse_uint64_slice_c +==== reverse_uint64s_c [source,c] ---- -void reverse_uint64_slice_c( cVarUint64Slice slice ); +void reverse_uint64s_c( cVarUint64s slice ); ---- {Reverse} -==== rotate_uint64_slice_c +==== rotate_uint64s_c [source,c] ---- -void rotate_uint64_slice_c( cVarUint64Slice slice, int64_t distance ); +void rotate_uint64s_c( cVarUint64s slice, int64_t distance ); ---- {Rotate} @@ -267,7 +267,7 @@ void rotate_uint64_slice_c( cVarUint64Slice slice, int64_t distance ); ==== sum_uint64_c [source,c] ---- -bool sum_uint64_c( cUint64Slice slice, uint64_t res[static 1] ); +bool sum_uint64_c( cUint64s slice, uint64_t res[static 1] ); ---- {Sum} diff --git a/doc/clingo/type/uint8.adoc b/doc/clingo/type/uint8.adoc index a56387c..63b2ea2 100644 --- a/doc/clingo/type/uint8.adoc +++ b/doc/clingo/type/uint8.adoc @@ -18,16 +18,16 @@ Module with functions and types to work with uint8_t values. //******************************************************************* Generated === Generated -[id='cUint8Slice'] -==== cUint8Slice +[id='cUint8s'] +==== cUint8s :Slice-Type: uint8_t const -:Slice-Slice: cUint8Slice +:Slice-Slice: cUint8s include::{docroot}/clingo/_tmpl/Slice.adoc[] -[id='cVarUint8Slice'] -==== cVarUint8Slice +[id='cVarUint8s'] +==== cVarUint8s :Slice-Type: uint8_t -:Slice-Slice: cVarUint8Slice +:Slice-Slice: cVarUint8s include::{docroot}/clingo/_tmpl/Slice.adoc[] //****************************************************************************** @@ -102,10 +102,10 @@ include::{xmpldir}/uint64_to_int8.c[] //************************************************************************ algo === algo -==== cmp_uint8_slice_c +==== cmp_uint8s_c [source,c] ---- -int cmp_uint8_slice_c( cUint8Slice a, cUint8Slice b ); +int cmp_uint8s_c( cUint8s a, cUint8s b ); ---- {CmpSlice} @@ -113,7 +113,7 @@ int cmp_uint8_slice_c( cUint8Slice a, cUint8Slice b ); ==== count_eq_uint8_c [source,c] ---- -int64_t count_eq_uint8_c( cUint8Slice slice, uint8_t val ); +int64_t count_eq_uint8_c( cUint8s slice, uint8_t val ); ---- {CountEq} @@ -121,7 +121,7 @@ int64_t count_eq_uint8_c( cUint8Slice slice, uint8_t val ); ==== find_uint8_c [source,c] ---- -uint8_t const* find_uint8_c( cUint8Slice slice, uint8_t val ); +uint8_t const* find_uint8_c( cUint8s slice, uint8_t val ); ---- {FindVal} @@ -129,7 +129,7 @@ uint8_t const* find_uint8_c( cUint8Slice slice, uint8_t val ); ==== max_uint8_c [source,c] ---- -uint8_t const* max_uint8_c( cUint8Slice slice ); +uint8_t const* max_uint8_c( cUint8s slice ); ---- {FindMax} @@ -137,7 +137,7 @@ uint8_t const* max_uint8_c( cUint8Slice slice ); ==== min_uint8_c [source,c] ---- -uint8_t const* min_uint8_c( cUint8Slice slice ); +uint8_t const* min_uint8_c( cUint8s slice ); ---- {FindMin} @@ -145,31 +145,31 @@ uint8_t const* min_uint8_c( cUint8Slice slice ); ==== prod_uint8_c [source,c] ---- -bool prod_uint8_c( cUint8Slice slice, uint64_t res[static 1] ); +bool prod_uint8_c( cUint8s slice, uint64_t res[static 1] ); ---- {Prod} -==== qsort_uint8_slice_c +==== qsort_uint8s_c [source,c] ---- -void qsort_uint8_slice_c( cVarUint8Slice slice ); +void qsort_uint8s_c( cVarUint8s slice ); ---- {Qsort} -==== reverse_uint8_slice_c +==== reverse_uint8s_c [source,c] ---- -void reverse_uint8_slice_c( cVarUint8Slice slice ); +void reverse_uint8s_c( cVarUint8s slice ); ---- {Reverse} -==== rotate_uint8_slice_c +==== rotate_uint8s_c [source,c] ---- -void rotate_uint8_slice_c( cVarUint8Slice slice, int64_t distance ); +void rotate_uint8s_c( cVarUint8s slice, int64_t distance ); ---- {Rotate} @@ -177,7 +177,7 @@ void rotate_uint8_slice_c( cVarUint8Slice slice, int64_t distance ); ==== sum_uint8_c [source,c] ---- -bool sum_uint8_c( cUint8Slice slice, uint64_t res[static 1] ); +bool sum_uint8_c( cUint8s slice, uint64_t res[static 1] ); ---- {Sum} diff --git a/inc/clingo/container/CInt64Vec.h b/inc/clingo/container/CInt64Vec.h index a11e3da..9d2d153 100644 --- a/inc/clingo/container/CInt64Vec.h +++ b/inc/clingo/container/CInt64Vec.h @@ -23,15 +23,15 @@ VAL_VEC_DEF_C_( #define add_many_to_int64_vec_c_( Vec, ... ) \ add_many_to_int64_vec_c( \ - (Vec), (cInt64Slice)slice_c_( int64_t, __VA_ARGS__ ) \ + (Vec), (cInt64s)slice_c_( int64_t, __VA_ARGS__ ) \ ) -CLINGO_API inline bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64Slice many ) +CLINGO_API inline bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64s many ) { return add_array_to_int64_vec_c( vec, many.s, many.v ); } -CLINGO_API cInt64Slice slice_of_int64_vec_c( CInt64Vec const* vec ); +CLINGO_API cInt64s slice_of_int64_vec_c( CInt64Vec const* vec ); -CLINGO_API cVarInt64Slice var_slice_of_int64_vec_c( CInt64Vec* vec ); +CLINGO_API cVarInt64s var_slice_of_int64_vec_c( CInt64Vec* vec ); #endif diff --git a/inc/clingo/container/map.h b/inc/clingo/container/map.h index ff8d213..5c26f67 100644 --- a/inc/clingo/container/map.h +++ b/inc/clingo/container/map.h @@ -681,7 +681,7 @@ CLINGO_API inline int64_t fibonacci_hash_index_c( uint64_t hash, uint8_t shift ) return i64; } -CLINGO_API inline uint64_t combine_hashes_c( cUint64Slice hashes ) +CLINGO_API inline uint64_t combine_hashes_c( cUint64s hashes ) { uint64_t hash = 17; each_c_( uint64_t const*, oth, hashes ) diff --git a/inc/clingo/type/double.h b/inc/clingo/type/double.h index 6cc9d44..496afe0 100755 --- a/inc/clingo/type/double.h +++ b/inc/clingo/type/double.h @@ -21,8 +21,8 @@ typedef struct cDoubleInfo cDoubleInfo; SLICES_C_( double, // Type - cDoubleSlice, // SliceType - cVarDoubleSlice // VarSliceType + cDoubles, // SliceType + cVarDoubles // VarSliceType ) /******************************************************************************* @@ -76,14 +76,22 @@ CLINGO_API double unpack_double_c( uint64_t u ); algo *******************************************************************************/ -CLINGO_API double const* find_double_c( cDoubleSlice, double val ); +CLINGO_API double const* find_double_c( cDoubles, double val ); -CLINGO_API double const* max_double_c( cDoubleSlice slice ); +CLINGO_API double const* max_double_c( cDoubles slice ); -CLINGO_API double const* min_double_c( cDoubleSlice slice ); +CLINGO_API double const* min_double_c( cDoubles slice ); -CLINGO_API bool prod_double_c( cDoubleSlice slice, double res[static 1] ); +CLINGO_API bool prod_double_c( cDoubles slice, double res[static 1] ); -CLINGO_API bool sum_double_c( cDoubleSlice slice, double res[static 1] ); +CLINGO_API bool sum_double_c( cDoubles slice, double res[static 1] ); + +/******************************************************************************* + +*******************************************************************************/ + +#define trunc_double_c_( D ) \ + trunc_double_c( (D), NULL ) +CLINGO_API double trunc_double_c( double d, double* diff ); #endif diff --git a/inc/clingo/type/float.h b/inc/clingo/type/float.h index 40d6bb9..baa16b7 100755 --- a/inc/clingo/type/float.h +++ b/inc/clingo/type/float.h @@ -22,8 +22,8 @@ typedef struct cFloatInfo cFloatInfo; SLICES_C_( float, // Type - cFloatSlice, // SliceType - cVarFloatSlice // VarSliceType + cFloats, // SliceType + cVarFloats // VarSliceType ) /******************************************************************************* @@ -75,14 +75,22 @@ CLINGO_API float unpack_float_c( uint32_t u ); *******************************************************************************/ -CLINGO_API float const* find_float_c( cFloatSlice slice, float f ); +CLINGO_API float const* find_float_c( cFloats slice, float f ); -CLINGO_API float const* max_float_c( cFloatSlice slice ); +CLINGO_API float const* max_float_c( cFloats slice ); -CLINGO_API float const* min_float_c( cFloatSlice slice ); +CLINGO_API float const* min_float_c( cFloats slice ); -CLINGO_API bool prod_float_c( cFloatSlice slice, float res[static 1] ); +CLINGO_API bool prod_float_c( cFloats slice, float res[static 1] ); -CLINGO_API bool sum_float_c( cFloatSlice slice, float res[static 1] ); +CLINGO_API bool sum_float_c( cFloats slice, float res[static 1] ); + +/******************************************************************************* + +*******************************************************************************/ + +#define trunc_float_c_( F ) \ + trunc_float_c( (F), NULL ) +CLINGO_API float trunc_float_c( float f, float* diff ); #endif diff --git a/inc/clingo/type/int16.h b/inc/clingo/type/int16.h index 7857a25..17e6c1e 100755 --- a/inc/clingo/type/int16.h +++ b/inc/clingo/type/int16.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - int16_t, // Type - cInt16Slice, // SliceType - cVarInt16Slice // VarSliceType + int16_t, // Type + cInt16s, // SliceType + cVarInt16s // VarSliceType ) /******************************************************************************* @@ -85,24 +85,24 @@ CLINGO_API inline int16_t swap_int16_to_c( int16_t val, c_ByteOrder order ) algo *******************************************************************************/ -CLINGO_API int cmp_int16_slice_c( cInt16Slice a, cInt16Slice b ); +CLINGO_API int cmp_int16s_c( cInt16s a, cInt16s b ); -CLINGO_API int64_t count_eq_int16_c( cInt16Slice slice, int16_t val ); +CLINGO_API int64_t count_eq_int16_c( cInt16s slice, int16_t val ); -CLINGO_API int16_t const* find_int16_c( cInt16Slice slice, int16_t val ); +CLINGO_API int16_t const* find_int16_c( cInt16s slice, int16_t val ); -CLINGO_API int16_t const* max_int16_c( cInt16Slice slice ); +CLINGO_API int16_t const* max_int16_c( cInt16s slice ); -CLINGO_API int16_t const* min_int16_c( cInt16Slice slice ); +CLINGO_API int16_t const* min_int16_c( cInt16s slice ); -CLINGO_API bool prod_int16_c( cInt16Slice slice, int64_t res[static 1] ); +CLINGO_API bool prod_int16_c( cInt16s slice, int64_t res[static 1] ); -CLINGO_API void qsort_int16_slice_c( cVarInt16Slice slice ); +CLINGO_API void qsort_int16s_c( cVarInt16s slice ); -CLINGO_API void reverse_int16_slice_c( cVarInt16Slice slice ); +CLINGO_API void reverse_int16s_c( cVarInt16s slice ); -CLINGO_API void rotate_int16_slice_c( cVarInt16Slice slice, int64_t distance ); +CLINGO_API void rotate_int16s_c( cVarInt16s slice, int64_t distance ); -CLINGO_API bool sum_int16_c( cInt16Slice slice, int64_t res[static 1] ); +CLINGO_API bool sum_int16_c( cInt16s slice, int64_t res[static 1] ); #endif diff --git a/inc/clingo/type/int32.h b/inc/clingo/type/int32.h index 0a33f79..4596e6b 100755 --- a/inc/clingo/type/int32.h +++ b/inc/clingo/type/int32.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - int32_t, // Type - cInt32Slice, // SliceType - cVarInt32Slice // VarSliceType + int32_t, // Type + cInt32s, // SliceType + cVarInt32s // VarSliceType ) /******************************************************************************* @@ -85,31 +85,31 @@ CLINGO_API inline int32_t swap_int32_to_c( int32_t val, c_ByteOrder order ) algo *******************************************************************************/ -CLINGO_API int32_t const* bsearch_int32_c( cInt32Slice slice, int32_t val ); +CLINGO_API int32_t const* bsearch_int32_c( cInt32s slice, int32_t val ); -CLINGO_API int cmp_int32_slice_c( cInt32Slice a, cInt32Slice b ); +CLINGO_API int cmp_int32s_c( cInt32s a, cInt32s b ); -CLINGO_API int64_t count_eq_int32_c( cInt32Slice slice, int32_t val ); +CLINGO_API int64_t count_eq_int32_c( cInt32s slice, int32_t val ); -CLINGO_API int32_t const* find_int32_c( cInt32Slice slice, int32_t val ); +CLINGO_API int32_t const* find_int32_c( cInt32s slice, int32_t val ); -CLINGO_API int32_t const* max_int32_c( cInt32Slice slice ); +CLINGO_API int32_t const* max_int32_c( cInt32s slice ); -CLINGO_API int32_t const* min_int32_c( cInt32Slice slice ); +CLINGO_API int32_t const* min_int32_c( cInt32s slice ); -CLINGO_API bool prod_int32_c( cInt32Slice slice, int64_t res[static 1] ); +CLINGO_API bool prod_int32_c( cInt32s slice, int64_t res[static 1] ); -CLINGO_API void qsort_int32_slice_c( cVarInt32Slice slice ); +CLINGO_API void qsort_int32s_c( cVarInt32s slice ); -CLINGO_API bool remove_int32_c( cVarInt32Slice slice[static 1], int64_t pos ); +CLINGO_API bool remove_int32_c( cVarInt32s slice[static 1], int64_t pos ); -CLINGO_API void reverse_int32_slice_c( cVarInt32Slice slice ); +CLINGO_API void reverse_int32s_c( cVarInt32s slice ); -CLINGO_API void rotate_int32_slice_c( cVarInt32Slice slice, int64_t distance ); +CLINGO_API void rotate_int32s_c( cVarInt32s slice, int64_t distance ); -CLINGO_API bool sum_int32_c( cInt32Slice slice, int64_t res[static 1] ); +CLINGO_API bool sum_int32_c( cInt32s slice, int64_t res[static 1] ); -CLINGO_API bool take_int32_c( cVarInt32Slice slice[static 1], +CLINGO_API bool take_int32_c( cVarInt32s slice[static 1], int64_t pos, int32_t val[static 1] ); diff --git a/inc/clingo/type/int64.h b/inc/clingo/type/int64.h index 3665d62..c1d6f17 100755 --- a/inc/clingo/type/int64.h +++ b/inc/clingo/type/int64.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - int64_t, // Type - cInt64Slice, // SliceType - cVarInt64Slice // VarSliceType + int64_t, // Type + cInt64s, // SliceType + cVarInt64s // VarSliceType ) /******************************************************************************* @@ -102,31 +102,31 @@ CLINGO_API inline int64_t next_pow2_int64_c( int64_t val ) algo *******************************************************************************/ -CLINGO_API int64_t const* bsearch_int64_c( cInt64Slice slice, int64_t val ); +CLINGO_API int64_t const* bsearch_int64_c( cInt64s slice, int64_t val ); -CLINGO_API int cmp_int64_slice_c( cInt64Slice a, cInt64Slice b ); +CLINGO_API int cmp_int64s_c( cInt64s a, cInt64s b ); -CLINGO_API int64_t count_eq_int64_c( cInt64Slice slice, int64_t val ); +CLINGO_API int64_t count_eq_int64_c( cInt64s slice, int64_t val ); -CLINGO_API int64_t const* find_int64_c( cInt64Slice slice, int64_t val ); +CLINGO_API int64_t const* find_int64_c( cInt64s slice, int64_t val ); -CLINGO_API int64_t const* max_int64_c( cInt64Slice slice ); +CLINGO_API int64_t const* max_int64_c( cInt64s slice ); -CLINGO_API int64_t const* min_int64_c( cInt64Slice slice ); +CLINGO_API int64_t const* min_int64_c( cInt64s slice ); -CLINGO_API bool prod_int64_c( cInt64Slice slice, int64_t res[static 1] ); +CLINGO_API bool prod_int64_c( cInt64s slice, int64_t res[static 1] ); -CLINGO_API void qsort_int64_slice_c( cVarInt64Slice slice ); +CLINGO_API void qsort_int64s_c( cVarInt64s slice ); -CLINGO_API bool remove_int64_c( cVarInt64Slice slice[static 1], int64_t pos ); +CLINGO_API bool remove_int64_c( cVarInt64s slice[static 1], int64_t pos ); -CLINGO_API void reverse_int64_slice_c( cVarInt64Slice slice ); +CLINGO_API void reverse_int64s_c( cVarInt64s slice ); -CLINGO_API void rotate_int64_slice_c( cVarInt64Slice slice, int64_t distance ); +CLINGO_API void rotate_int64s_c( cVarInt64s slice, int64_t distance ); -CLINGO_API bool sum_int64_c( cInt64Slice slice, int64_t res[static 1] ); +CLINGO_API bool sum_int64_c( cInt64s slice, int64_t res[static 1] ); -CLINGO_API bool take_int64_c( cVarInt64Slice slice[static 1], +CLINGO_API bool take_int64_c( cVarInt64s slice[static 1], int64_t pos, int64_t val[static 1] ); diff --git a/inc/clingo/type/int8.h b/inc/clingo/type/int8.h index eee853f..2cb96d5 100755 --- a/inc/clingo/type/int8.h +++ b/inc/clingo/type/int8.h @@ -13,9 +13,9 @@ *******************************************************************************/ SLICES_C_( - int8_t, // Type - cInt8Slice, // SliceType - cVarInt8Slice // VarSliceType + int8_t, // Type + cInt8s, // SliceType + cVarInt8s // VarSliceType ) /******************************************************************************* @@ -58,24 +58,24 @@ CLINGO_API inline CONV_C_( algo *******************************************************************************/ -CLINGO_API int cmp_int8_slice_c( cInt8Slice a, cInt8Slice b ); +CLINGO_API int cmp_int8s_c( cInt8s a, cInt8s b ); -CLINGO_API int64_t count_eq_int8_c( cInt8Slice slice, int8_t val ); +CLINGO_API int64_t count_eq_int8_c( cInt8s slice, int8_t val ); -CLINGO_API int8_t const* find_int8_c( cInt8Slice slice, int8_t val ); +CLINGO_API int8_t const* find_int8_c( cInt8s slice, int8_t val ); -CLINGO_API int8_t const* max_int8_c( cInt8Slice slice ); +CLINGO_API int8_t const* max_int8_c( cInt8s slice ); -CLINGO_API int8_t const* min_int8_c( cInt8Slice slice ); +CLINGO_API int8_t const* min_int8_c( cInt8s slice ); -CLINGO_API bool prod_int8_c( cInt8Slice slice, int64_t res[static 1] ); +CLINGO_API bool prod_int8_c( cInt8s slice, int64_t res[static 1] ); -CLINGO_API void qsort_int8_slice_c( cVarInt8Slice slice ); +CLINGO_API void qsort_int8s_c( cVarInt8s slice ); -CLINGO_API void reverse_int8_slice_c( cVarInt8Slice slice ); +CLINGO_API void reverse_int8s_c( cVarInt8s slice ); -CLINGO_API void rotate_int8_slice_c( cVarInt8Slice slice, int64_t distance ); +CLINGO_API void rotate_int8s_c( cVarInt8s slice, int64_t distance ); -CLINGO_API bool sum_int8_c( cInt8Slice slice, int64_t res[static 1] ); +CLINGO_API bool sum_int8_c( cInt8s slice, int64_t res[static 1] ); #endif diff --git a/inc/clingo/type/uint16.h b/inc/clingo/type/uint16.h index 7d50dd4..2d85bb6 100755 --- a/inc/clingo/type/uint16.h +++ b/inc/clingo/type/uint16.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - uint16_t, // Type - cUint16Slice, // SliceType - cVarUint16Slice // VarSliceType + uint16_t, // Type + cUint16s, // SliceType + cVarUint16s // VarSliceType ) /******************************************************************************* @@ -78,24 +78,24 @@ CLINGO_API inline uint16_t swap_uint16_to_c( uint16_t val, c_ByteOrder order ) algo *******************************************************************************/ -CLINGO_API int cmp_uint16_slice_c( cUint16Slice a, cUint16Slice b ); +CLINGO_API int cmp_uint16s_c( cUint16s a, cUint16s b ); -CLINGO_API int64_t count_eq_uint16_c( cUint16Slice slice, uint16_t val ); +CLINGO_API int64_t count_eq_uint16_c( cUint16s slice, uint16_t val ); -CLINGO_API uint16_t const* find_uint16_c( cUint16Slice slice, uint16_t val ); +CLINGO_API uint16_t const* find_uint16_c( cUint16s slice, uint16_t val ); -CLINGO_API uint16_t const* max_uint16_c( cUint16Slice slice ); +CLINGO_API uint16_t const* max_uint16_c( cUint16s slice ); -CLINGO_API uint16_t const* min_uint16_c( cUint16Slice slice ); +CLINGO_API uint16_t const* min_uint16_c( cUint16s slice ); -CLINGO_API bool prod_uint16_c( cUint16Slice slice, uint64_t res[static 1] ); +CLINGO_API bool prod_uint16_c( cUint16s slice, uint64_t res[static 1] ); -CLINGO_API void qsort_uint16_slice_c( cVarUint16Slice slice ); +CLINGO_API void qsort_uint16s_c( cVarUint16s slice ); -CLINGO_API void reverse_uint16_slice_c( cVarUint16Slice slice ); +CLINGO_API void reverse_uint16s_c( cVarUint16s slice ); -CLINGO_API void rotate_uint16_slice_c( cVarUint16Slice slice, int64_t distance ); +CLINGO_API void rotate_uint16s_c( cVarUint16s slice, int64_t distance ); -CLINGO_API bool sum_uint16_c( cUint16Slice slice, uint64_t res[static 1] ); +CLINGO_API bool sum_uint16_c( cUint16s slice, uint64_t res[static 1] ); #endif diff --git a/inc/clingo/type/uint32.h b/inc/clingo/type/uint32.h index 0349b12..7ca85af 100755 --- a/inc/clingo/type/uint32.h +++ b/inc/clingo/type/uint32.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - uint32_t, // Type - cUint32Slice, // SliceType - cVarUint32Slice // VarSliceType + uint32_t, // Type + cUint32s, // SliceType + cVarUint32s // VarSliceType ) /******************************************************************************* @@ -97,24 +97,24 @@ CLINGO_API inline uint32_t next_pow2_uint32_c( uint32_t val ) algo *******************************************************************************/ -CLINGO_API int cmp_uint32_slice_c( cUint32Slice a, cUint32Slice b ); +CLINGO_API int cmp_uint32s_c( cUint32s a, cUint32s b ); -CLINGO_API int64_t count_eq_uint32_c( cUint32Slice slice, uint32_t val ); +CLINGO_API int64_t count_eq_uint32_c( cUint32s slice, uint32_t val ); -CLINGO_API uint32_t const* find_uint32_c( cUint32Slice slice, uint32_t val ); +CLINGO_API uint32_t const* find_uint32_c( cUint32s slice, uint32_t val ); -CLINGO_API uint32_t const* max_uint32_c( cUint32Slice slice ); +CLINGO_API uint32_t const* max_uint32_c( cUint32s slice ); -CLINGO_API uint32_t const* min_uint32_c( cUint32Slice slice ); +CLINGO_API uint32_t const* min_uint32_c( cUint32s slice ); -CLINGO_API bool prod_uint32_c( cUint32Slice slice, uint64_t res[static 1] ); +CLINGO_API bool prod_uint32_c( cUint32s slice, uint64_t res[static 1] ); -CLINGO_API void qsort_uint32_slice_c( cVarUint32Slice slice ); +CLINGO_API void qsort_uint32s_c( cVarUint32s slice ); -CLINGO_API void reverse_uint32_slice_c( cVarUint32Slice slice ); +CLINGO_API void reverse_uint32s_c( cVarUint32s slice ); -CLINGO_API void rotate_uint32_slice_c( cVarUint32Slice slice, int64_t distance ); +CLINGO_API void rotate_uint32s_c( cVarUint32s slice, int64_t distance ); -CLINGO_API bool sum_uint32_c( cUint32Slice slice, uint64_t res[static 1] ); +CLINGO_API bool sum_uint32_c( cUint32s slice, uint64_t res[static 1] ); #endif diff --git a/inc/clingo/type/uint64.h b/inc/clingo/type/uint64.h index 94a4b4a..2492877 100755 --- a/inc/clingo/type/uint64.h +++ b/inc/clingo/type/uint64.h @@ -14,9 +14,9 @@ *******************************************************************************/ SLICES_C_( - uint64_t, // Type - cUint64Slice, // SliceType - cVarUint64Slice // VarSliceType + uint64_t, // Type + cUint64s, // SliceType + cVarUint64s // VarSliceType ) /******************************************************************************* @@ -123,24 +123,24 @@ CLINGO_API inline uint8_t log2_uint64_c( uint64_t val ) algo *******************************************************************************/ -CLINGO_API int cmp_uint64_slice_c( cUint64Slice a, cUint64Slice b ); +CLINGO_API int cmp_uint64s_c( cUint64s a, cUint64s b ); -CLINGO_API int64_t count_eq_uint64_c( cUint64Slice slice, uint64_t val ); +CLINGO_API int64_t count_eq_uint64_c( cUint64s slice, uint64_t val ); -CLINGO_API uint64_t const* find_uint64_c( cUint64Slice slice, uint64_t val ); +CLINGO_API uint64_t const* find_uint64_c( cUint64s slice, uint64_t val ); -CLINGO_API uint64_t const* max_uint64_c( cUint64Slice slice ); +CLINGO_API uint64_t const* max_uint64_c( cUint64s slice ); -CLINGO_API uint64_t const* min_uint64_c( cUint64Slice slice ); +CLINGO_API uint64_t const* min_uint64_c( cUint64s slice ); -CLINGO_API bool prod_uint64_c( cUint64Slice slice, uint64_t res[static 1] ); +CLINGO_API bool prod_uint64_c( cUint64s slice, uint64_t res[static 1] ); -CLINGO_API void qsort_uint64_slice_c( cVarUint64Slice slice ); +CLINGO_API void qsort_uint64s_c( cVarUint64s slice ); -CLINGO_API void reverse_uint64_slice_c( cVarUint64Slice slice ); +CLINGO_API void reverse_uint64s_c( cVarUint64s slice ); -CLINGO_API void rotate_uint64_slice_c( cVarUint64Slice slice, int64_t distance ); +CLINGO_API void rotate_uint64s_c( cVarUint64s slice, int64_t distance ); -CLINGO_API bool sum_uint64_c( cUint64Slice slice, uint64_t res[static 1] ); +CLINGO_API bool sum_uint64_c( cUint64s slice, uint64_t res[static 1] ); #endif diff --git a/inc/clingo/type/uint8.h b/inc/clingo/type/uint8.h index 5b61ad8..f3303d5 100755 --- a/inc/clingo/type/uint8.h +++ b/inc/clingo/type/uint8.h @@ -14,8 +14,8 @@ SLICES_C_( uint8_t, // Type - cUint8Slice, // SliceType - cVarUint8Slice // VarSliceType + cUint8s, // SliceType + cVarUint8s // VarSliceType ) /******************************************************************************* @@ -58,24 +58,24 @@ CLINGO_API inline CONV_C_( algo *******************************************************************************/ -CLINGO_API int cmp_uint8_slice_c( cUint8Slice a, cUint8Slice b ); +CLINGO_API int cmp_uint8s_c( cUint8s a, cUint8s b ); -CLINGO_API int64_t count_eq_uint8_c( cUint8Slice slice, uint8_t val ); +CLINGO_API int64_t count_eq_uint8_c( cUint8s slice, uint8_t val ); -CLINGO_API uint8_t const* find_uint8_c( cUint8Slice slice, uint8_t val ); +CLINGO_API uint8_t const* find_uint8_c( cUint8s slice, uint8_t val ); -CLINGO_API uint8_t const* max_uint8_c( cUint8Slice slice ); +CLINGO_API uint8_t const* max_uint8_c( cUint8s slice ); -CLINGO_API uint8_t const* min_uint8_c( cUint8Slice slice ); +CLINGO_API uint8_t const* min_uint8_c( cUint8s slice ); -CLINGO_API bool prod_uint8_c( cUint8Slice slice, uint64_t res[static 1] ); +CLINGO_API bool prod_uint8_c( cUint8s slice, uint64_t res[static 1] ); -CLINGO_API void qsort_uint8_slice_c( cVarUint8Slice slice ); +CLINGO_API void qsort_uint8s_c( cVarUint8s slice ); -CLINGO_API void reverse_uint8_slice_c( cVarUint8Slice slice ); +CLINGO_API void reverse_uint8s_c( cVarUint8s slice ); -CLINGO_API void rotate_uint8_slice_c( cVarUint8Slice slice, int64_t distance ); +CLINGO_API void rotate_uint8s_c( cVarUint8s slice, int64_t distance ); -CLINGO_API bool sum_uint8_c( cUint8Slice slice, uint64_t res[static 1] ); +CLINGO_API bool sum_uint8_c( cUint8s slice, uint64_t res[static 1] ); #endif diff --git a/src/clingo/color/cColor.c b/src/clingo/color/cColor.c index cc5031a..fdc98e5 100644 --- a/src/clingo/color/cColor.c +++ b/src/clingo/color/cColor.c @@ -152,7 +152,7 @@ cCmyk32 as_cmyk32_c( cColor color ) cCmyk as_cmyk_c( cColor color ) { cRgb rgb = as_rgb_c( color ); - cFloatSlice rgbFloats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); + cFloats rgbFloats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); cCmyk fcmyk; fcmyk.key = 1.0f - *max_float_c( rgbFloats ); fcmyk.cyan = ( 1.0f - rgb.red - fcmyk.key ) / ( 1.0f - fcmyk.key ); @@ -164,7 +164,7 @@ cCmyk as_cmyk_c( cColor color ) cHsl as_hsl_c( cColor color ) { cRgb rgb = as_rgb_c( color ); - cFloatSlice floats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); + cFloats floats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); float max = *max_float_c( floats ); float min = *min_float_c( floats ); float delta = max - min; @@ -200,7 +200,7 @@ cHsl as_hsl_c( cColor color ) cHsv as_hsv_c( cColor color ) { cRgb rgb = as_rgb_c( color ); - cFloatSlice floats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); + cFloats floats = slice_c_( float, rgb.red, rgb.green, rgb.blue ); float max = *max_float_c( floats ); float min = *min_float_c( floats ); float delta = max - min; diff --git a/src/clingo/container/CInt64Vec.c b/src/clingo/container/CInt64Vec.c index df23ff5..7e0c14f 100644 --- a/src/clingo/container/CInt64Vec.c +++ b/src/clingo/container/CInt64Vec.c @@ -17,16 +17,16 @@ VAL_VEC_IMPL_C_( overall *******************************************************************************/ -extern inline bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64Slice many ); +extern inline bool add_many_to_int64_vec_c( CInt64Vec* vec, cInt64s many ); SLICE_OF_VEC_C_( int64_vec_c, // FuncSuffix CInt64Vec, // VecType - cInt64Slice // SliceType + cInt64s // SliceType ) VAR_SLICE_OF_VEC_C_( int64_vec_c, // FuncSuffix CInt64Vec, // VecType - cVarInt64Slice // SliceType + cVarInt64s // SliceType ) diff --git a/src/clingo/container/map.c b/src/clingo/container/map.c index fb82e30..22bdf39 100644 --- a/src/clingo/container/map.c +++ b/src/clingo/container/map.c @@ -16,7 +16,7 @@ extern inline float calculate_load_c( int64_t cap, int64_t count ); extern inline int64_t fibonacci_hash_index_c( uint64_t hash, uint8_t shift ); -extern inline uint64_t compine_hashes_c( cUint64Slice hashes ); +extern inline uint64_t compine_hashes_c( cUint64s hashes ); /******************************************************************************* info diff --git a/src/clingo/time/c_Month.c b/src/clingo/time/c_Month.c index 50dc359..214378b 100644 --- a/src/clingo/time/c_Month.c +++ b/src/clingo/time/c_Month.c @@ -56,9 +56,9 @@ int8_t days_per_month_c( c_Month month, bool leapYear ) int16_t first_month_day_of_year_c( c_Month month, bool leapYear ) { - cInt8Slice slice = leapYear - ? (cInt8Slice){ month - 1, DaysPerMonthInLeapYear } - : (cInt8Slice){ month - 1, DaysPerMonth }; + cInt8s slice = leapYear + ? (cInt8s){ month - 1, DaysPerMonthInLeapYear } + : (cInt8s){ month - 1, DaysPerMonth }; int64_t sum = 0; sum_int8_c( slice, &sum ); diff --git a/src/clingo/type/double.c b/src/clingo/type/double.c index 2ec5f2a..a875af4 100755 --- a/src/clingo/type/double.c +++ b/src/clingo/type/double.c @@ -109,7 +109,7 @@ double unpack_double_c( uint64_t u ) FIND_VAL_C_( find_double_c, // FuncName - cDoubleSlice, // SliceType + cDoubles, // SliceType double const, // ValueType double, // SearchType cmp_double_c, // CmpFunc @@ -118,7 +118,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_double_c, // FuncName - cDoubleSlice, // SliceType + cDoubles, // SliceType double const, // ValueType cmp_double_c, // CmpFunc do_deref_c_ // DoDeref @@ -126,7 +126,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_double_c, // FuncName - cDoubleSlice, // SliceType + cDoubles, // SliceType double const, // ValueType cmp_double_c, // CmpFunc do_deref_c_ // DoDeref @@ -140,7 +140,7 @@ static bool mul_func( double a, double b, double res[static 1] ) PROD_C_( prod_double_c, // FuncName - cDoubleSlice, // SliceType + cDoubles, // SliceType double, // ValueType double, // ResType mul_func // MulFunc @@ -154,9 +154,22 @@ static bool add_func( double a, double b, double res[static 1] ) SUM_C_( sum_double_c, // FuncName - cDoubleSlice, // SliceType + cDoubles, // SliceType double, // ValueType double, // ResType add_func // AddFunc ) +/******************************************************************************* + +*******************************************************************************/ + +double trunc_double_c( double d, double* diff ) +{ + double res = trunc( d ); + if ( diff != NULL ) + { + *diff = d - res; + } + return res; +} diff --git a/src/clingo/type/float.c b/src/clingo/type/float.c index a898635..10bcd12 100755 --- a/src/clingo/type/float.c +++ b/src/clingo/type/float.c @@ -102,7 +102,7 @@ float unpack_float_c( uint32_t u ) FIND_VAL_C_( find_float_c, // FuncName - cFloatSlice, // SliceType + cFloats, // SliceType float const, // ValueType float, // SearchType cmp_float_c, // CmpFunc @@ -111,7 +111,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_float_c, // FuncName - cFloatSlice, // SliceType + cFloats, // SliceType float const, // ValueType cmp_float_c, // CmpFunc do_deref_c_ // DoDeref @@ -119,7 +119,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_float_c, // FuncName - cFloatSlice, // SliceType + cFloats, // SliceType float const, // ValueType cmp_float_c, // CmpFunc do_deref_c_ // DoDeref @@ -133,7 +133,7 @@ static bool mul_func( float a, float b, float res[static 1] ) PROD_C_( prod_float_c, // FuncName - cFloatSlice, // SliceType + cFloats, // SliceType float, // ValueType float, // ResType mul_func // MulFunc @@ -147,10 +147,22 @@ static bool add_func( float a, float b, float res[static 1] ) SUM_C_( sum_float_c, // FuncName - cFloatSlice, // SliceType + cFloats, // SliceType float, // ValueType float, // ResType add_func // AddFunc ) +/******************************************************************************* + +*******************************************************************************/ +float trunc_float_c( float f, float* diff ) +{ + float res = truncf( f ); + if ( diff != NULL ) + { + *diff = f - res; + } + return res; +} \ No newline at end of file diff --git a/src/clingo/type/int16.c b/src/clingo/type/int16.c index 7e1a9d5..aee630d 100755 --- a/src/clingo/type/int16.c +++ b/src/clingo/type/int16.c @@ -32,8 +32,8 @@ extern inline int16_t swap_int16_to_c( int16_t val, c_ByteOrder order ); *******************************************************************************/ CMP_SLICE_C_( - cmp_int16_slice_c, // FuncName - cInt16Slice, // SliceType + cmp_int16s_c, // FuncName + cInt16s, // SliceType int16_t const, // ValueType cmp_int16_c, // CmpFunc do_deref_c_ // DoDeref @@ -41,7 +41,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t const, // ValueType int16_t, // SearchType cmp_int16_c, // CmpFunc @@ -50,7 +50,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t const, // ValueType int16_t, // SearchType cmp_int16_c, // CmpFunc @@ -59,7 +59,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t const, // ValueType cmp_int16_c, // CmpFunc do_deref_c_ // DoDeref @@ -67,7 +67,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t const, // ValueType cmp_int16_c, // CmpFunc do_deref_c_ // DoDeref @@ -75,35 +75,35 @@ FIND_MIN_C_( PROD_C_( prod_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t, // ValueType int64_t, // ResType imul64_c // MulFunc ) QSORT_C_( - qsort_int16_slice_c, // FuncName - cVarInt16Slice, // SliceType + qsort_int16s_c, // FuncName + cVarInt16s, // SliceType int16_t, // ValueType cmp_int16_c, // CmpFunc do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_int16_slice_c, // FuncName - cVarInt16Slice, // SliceType + reverse_int16s_c, // FuncName + cVarInt16s, // SliceType int16_t // ValueType ) ROTATE_C_( - rotate_int16_slice_c, // FuncName - cVarInt16Slice, // SliceType + rotate_int16s_c, // FuncName + cVarInt16s, // SliceType int16_t // ValueType ) SUM_C_( sum_int16_c, // FuncName - cInt16Slice, // SliceType + cInt16s, // SliceType int16_t, // ValueType int64_t, // ResType iadd64_c // AddFunc diff --git a/src/clingo/type/int32.c b/src/clingo/type/int32.c index d053dd5..9bd67bc 100755 --- a/src/clingo/type/int32.c +++ b/src/clingo/type/int32.c @@ -33,7 +33,7 @@ extern inline int32_t swap_int32_to_c( int32_t val, c_ByteOrder order ); BSEARCH_C_( bsearch_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t const, // ValueType int32_t, // SearchType cmp_int32_c, // CmpFunc @@ -41,8 +41,8 @@ BSEARCH_C_( ) CMP_SLICE_C_( - cmp_int32_slice_c, // FuncName - cInt32Slice, // SliceType + cmp_int32s_c, // FuncName + cInt32s, // SliceType int32_t const, // ValueType cmp_int32_c, // CmpFunc do_deref_c_ // DoDeref @@ -50,7 +50,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t const, // ValueType int32_t, // SearchType cmp_int32_c, // CmpFunc @@ -59,7 +59,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t const, // ValueType int32_t, // SearchType cmp_int32_c, // CmpFunc @@ -68,7 +68,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t const, // ValueType cmp_int32_c, // CmpFunc do_deref_c_ // DoDeref @@ -76,7 +76,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t const, // ValueType cmp_int32_c, // CmpFunc do_deref_c_ // DoDeref @@ -84,15 +84,15 @@ FIND_MIN_C_( PROD_C_( prod_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t, // ValueType int64_t, // ResType imul64_c // MulFunc ) QSORT_C_( - qsort_int32_slice_c, // FuncName - cVarInt32Slice, // SliceType + qsort_int32s_c, // FuncName + cVarInt32s, // SliceType int32_t, // ValueType cmp_int32_c, // CmpFunc do_deref_c_ // DoDeref @@ -100,25 +100,25 @@ QSORT_C_( REMOVE_C_( remove_int32_c, // FuncName - cVarInt32Slice, // SliceType + cVarInt32s, // SliceType int32_t // ValueType ) REVERSE_C_( - reverse_int32_slice_c, // FuncName - cVarInt32Slice, // SliceType + reverse_int32s_c, // FuncName + cVarInt32s, // SliceType int32_t // ValueType ) ROTATE_C_( - rotate_int32_slice_c, // FuncName - cVarInt32Slice, // SliceType + rotate_int32s_c, // FuncName + cVarInt32s, // SliceType int32_t // ValueType ) SUM_C_( sum_int32_c, // FuncName - cInt32Slice, // SliceType + cInt32s, // SliceType int32_t, // ValueType int64_t, // ResType iadd64_c // AddFunc @@ -126,6 +126,6 @@ SUM_C_( TAKE_C_( take_int32_c, // FuncName - cVarInt32Slice, // SliceType + cVarInt32s, // SliceType int32_t // ValueType ) diff --git a/src/clingo/type/int64.c b/src/clingo/type/int64.c index 5a71d05..ef2826b 100755 --- a/src/clingo/type/int64.c +++ b/src/clingo/type/int64.c @@ -39,7 +39,7 @@ extern inline int64_t next_pow2_int64_c( int64_t val ); BSEARCH_C_( bsearch_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t const, // ValueType int64_t, // SearchType cmp_int64_c, // CmpFunc @@ -47,8 +47,8 @@ BSEARCH_C_( ) CMP_SLICE_C_( - cmp_int64_slice_c, // FuncName - cInt64Slice, // SliceType + cmp_int64s_c, // FuncName + cInt64s, // SliceType int64_t const, // ValueType cmp_int64_c, // ValueType do_deref_c_ // DoDeref @@ -56,7 +56,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t const, // ValueType int64_t, // SearchType cmp_int64_c, // CmpFunc @@ -65,7 +65,7 @@ COUNT_EQ_C_( FIND_MAX_C_( max_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t const, // ValueType cmp_int64_c, // CmpFunc do_deref_c_ // DoDeref @@ -73,7 +73,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t const, // ValueType cmp_int64_c, // CmpFunc do_deref_c_ // DoDeref @@ -81,7 +81,7 @@ FIND_MIN_C_( FIND_VAL_C_( find_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t const, // ValueType int64_t, // SearchType cmp_int64_c, // CmpFunc @@ -90,15 +90,15 @@ FIND_VAL_C_( PROD_C_( prod_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t, // ValueType int64_t, // ResType imul64_c // MulFunc ) QSORT_C_( - qsort_int64_slice_c, // FuncName - cVarInt64Slice, // SliceType + qsort_int64s_c, // FuncName + cVarInt64s, // SliceType int64_t, // ValueType cmp_int64_c, // CmpFunc do_deref_c_ // DoDeref @@ -106,25 +106,25 @@ QSORT_C_( REMOVE_C_( remove_int64_c, // FuncName - cVarInt64Slice, // SliceType + cVarInt64s, // SliceType int64_t // ValueType ) REVERSE_C_( - reverse_int64_slice_c, // FuncName - cVarInt64Slice, // SliceType + reverse_int64s_c, // FuncName + cVarInt64s, // SliceType int64_t // ValueType ) ROTATE_C_( - rotate_int64_slice_c, // FuncName - cVarInt64Slice, // SliceType + rotate_int64s_c, // FuncName + cVarInt64s, // SliceType int64_t // ValueType ) SUM_C_( sum_int64_c, // FuncName - cInt64Slice, // SliceType + cInt64s, // SliceType int64_t, // ValueType int64_t, // ResType iadd64_c // AddFunc @@ -132,6 +132,6 @@ SUM_C_( TAKE_C_( take_int64_c, // FuncName - cVarInt64Slice, // SliceType + cVarInt64s, // SliceType int64_t // ValueType ) diff --git a/src/clingo/type/int8.c b/src/clingo/type/int8.c index 1fbc651..4591e8c 100755 --- a/src/clingo/type/int8.c +++ b/src/clingo/type/int8.c @@ -24,8 +24,8 @@ extern inline bool uint64_to_int8_c( uint64_t src, int8_t dest[static 1] ); *******************************************************************************/ CMP_SLICE_C_( - cmp_int8_slice_c, // FuncName - cInt8Slice, // SliceType + cmp_int8s_c, // FuncName + cInt8s, // SliceType int8_t const, // ValueType cmp_int8_c, // CmpFunc do_deref_c_ // DoDeref @@ -33,7 +33,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t const, // ValueType int8_t, // SearchType cmp_int8_c, // CmpFunc @@ -42,7 +42,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t const, // ValueType int8_t, // SearchType cmp_int8_c, // CmpFunc @@ -51,7 +51,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t const, // ValueType cmp_int8_c, // CmpFunc do_deref_c_ // DoDeref @@ -59,7 +59,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t const, // ValueType cmp_int8_c, // CmpFunc do_deref_c_ // DoDeref @@ -67,35 +67,35 @@ FIND_MIN_C_( PROD_C_( prod_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t, // ValueType int64_t, // ResType imul64_c // MulFunc ) QSORT_C_( - qsort_int8_slice_c, // FuncName - cVarInt8Slice, // SliceType + qsort_int8s_c, // FuncName + cVarInt8s, // SliceType int8_t, // ValueType cmp_int8_c, // FuncName do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_int8_slice_c, // FuncName - cVarInt8Slice, // SliceType + reverse_int8s_c, // FuncName + cVarInt8s, // SliceType int8_t // ValueType ) ROTATE_C_( - rotate_int8_slice_c, // FuncName - cVarInt8Slice, // SliceType + rotate_int8s_c, // FuncName + cVarInt8s, // SliceType int8_t // ValueType ) SUM_C_( sum_int8_c, // FuncName - cInt8Slice, // SliceType + cInt8s, // SliceType int8_t, // ValueType int64_t, // ResType iadd64_c // AddFunc diff --git a/src/clingo/type/uint16.c b/src/clingo/type/uint16.c index caa873b..a512072 100755 --- a/src/clingo/type/uint16.c +++ b/src/clingo/type/uint16.c @@ -32,8 +32,8 @@ extern inline uint16_t swap_uint16_to_c( uint16_t val, c_ByteOrder order ); *******************************************************************************/ CMP_SLICE_C_( - cmp_uint16_slice_c, // FuncName - cUint16Slice, // SliceType + cmp_uint16s_c, // FuncName + cUint16s, // SliceType uint16_t const, // ValueType cmp_uint16_c, // CmpFunc do_deref_c_ // DoDeref @@ -41,7 +41,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t const, // ValueType uint16_t, // SearchType cmp_uint16_c, // CmpFunc @@ -50,7 +50,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t const, // ValueType uint16_t, // SearchType cmp_uint16_c, // CmpFunc @@ -59,7 +59,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t const, // ValueType cmp_uint16_c, // CmpFunc do_deref_c_ // DoDeref @@ -67,7 +67,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t const, // ValueType cmp_uint16_c, // CmpFunc do_deref_c_ // DoDeref @@ -75,35 +75,35 @@ FIND_MIN_C_( PROD_C_( prod_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t, // ValueType uint64_t, // ResType umul64_c // MulFunc ) QSORT_C_( - qsort_uint16_slice_c, // FuncName - cVarUint16Slice, // SliceType + qsort_uint16s_c, // FuncName + cVarUint16s, // SliceType uint16_t, // ValueType cmp_uint16_c, // CmpFunc do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_uint16_slice_c, // FuncName - cVarUint16Slice, // SliceType + reverse_uint16s_c, // FuncName + cVarUint16s, // SliceType uint16_t // ValueType ) ROTATE_C_( - rotate_uint16_slice_c, // FuncName - cVarUint16Slice, // SliceType + rotate_uint16s_c, // FuncName + cVarUint16s, // SliceType uint16_t // ValueType ) SUM_C_( sum_uint16_c, // FuncName - cUint16Slice, // SliceType + cUint16s, // SliceType uint16_t, // ValueType uint64_t, // ResType uadd64_c // AddFunc diff --git a/src/clingo/type/uint32.c b/src/clingo/type/uint32.c index ebc01e8..a5b249f 100755 --- a/src/clingo/type/uint32.c +++ b/src/clingo/type/uint32.c @@ -38,8 +38,8 @@ extern inline uint32_t next_pow2_uint32_c( uint32_t val ); *******************************************************************************/ CMP_SLICE_C_( - cmp_uint32_slice_c, // FuncName - cUint32Slice, // SliceType + cmp_uint32s_c, // FuncName + cUint32s, // SliceType uint32_t const, // ValueType cmp_uint32_c, // CmpFunc do_deref_c_ // DoDeref @@ -47,7 +47,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t const, // ValueType uint32_t, // SearchType cmp_uint32_c, // CmpFunc @@ -56,7 +56,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t const, // ValueType uint32_t, // SearchType cmp_uint32_c, // CmpFunc @@ -65,7 +65,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t const, // ValueType cmp_uint32_c, // CmpFunc do_deref_c_ // DoDeref @@ -73,7 +73,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t const, // ValueType cmp_uint32_c, // CmpFunc do_deref_c_ // DoDeref @@ -81,35 +81,35 @@ FIND_MIN_C_( PROD_C_( prod_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t, // ValueType uint64_t, // ResType umul64_c // MulFunc ) QSORT_C_( - qsort_uint32_slice_c, // FuncName - cVarUint32Slice, // SliceType + qsort_uint32s_c, // FuncName + cVarUint32s, // SliceType uint32_t, // ValueType cmp_uint32_c, // CmpFunc do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_uint32_slice_c, // FuncName - cVarUint32Slice, // SliceType + reverse_uint32s_c, // FuncName + cVarUint32s, // SliceType uint32_t // ValueType ) ROTATE_C_( - rotate_uint32_slice_c, // FuncName - cVarUint32Slice, // SliceType + rotate_uint32s_c, // FuncName + cVarUint32s, // SliceType uint32_t // ValueType ) SUM_C_( sum_uint32_c, // FuncName - cUint32Slice, // SliceType + cUint32s, // SliceType uint32_t, // ValueType uint64_t, // ResType uadd64_c // AddFunc diff --git a/src/clingo/type/uint64.c b/src/clingo/type/uint64.c index dcf389a..3a9020d 100755 --- a/src/clingo/type/uint64.c +++ b/src/clingo/type/uint64.c @@ -39,8 +39,8 @@ extern inline uint64_t next_pow2_uint64_c( uint64_t val ); *******************************************************************************/ CMP_SLICE_C_( - cmp_uint64_slice_c, // FuncName - cUint64Slice, // SliceType + cmp_uint64s_c, // FuncName + cUint64s, // SliceType uint64_t const, // ValueType cmp_uint64_c, // CmpFunc do_deref_c_ // DoDeref @@ -48,7 +48,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t const, // ValueType uint64_t, // SearchType cmp_uint64_c, // CmpFunc @@ -57,7 +57,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t const, // ValueType uint64_t, // SearchType cmp_uint64_c, // CmpFunc @@ -66,7 +66,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t const, // ValueType cmp_uint64_c, // CmpFunc do_deref_c_ // DoDeref @@ -74,7 +74,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t const, // ValueType cmp_uint64_c, // CmpFunc do_deref_c_ // DoDeref @@ -82,35 +82,35 @@ FIND_MIN_C_( PROD_C_( prod_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t, // ValueType uint64_t, // ResType umul64_c // MulFunc ) QSORT_C_( - qsort_uint64_slice_c, // FuncName - cVarUint64Slice, // SliceType + qsort_uint64s_c, // FuncName + cVarUint64s, // SliceType uint64_t, // ValueType cmp_uint64_c, // CmpFunc do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_uint64_slice_c, // FuncName - cVarUint64Slice, // SliceType + reverse_uint64s_c, // FuncName + cVarUint64s, // SliceType uint64_t // ValueType ) ROTATE_C_( - rotate_uint64_slice_c, // FuncName - cVarUint64Slice, // SliceType + rotate_uint64s_c, // FuncName + cVarUint64s, // SliceType uint64_t // ValueType ) SUM_C_( sum_uint64_c, // FuncName - cUint64Slice, // SliceType + cUint64s, // SliceType uint64_t, // ValueType uint64_t, // ResType uadd64_c // AddFunc diff --git a/src/clingo/type/uint8.c b/src/clingo/type/uint8.c index 61d0d50..5b65681 100755 --- a/src/clingo/type/uint8.c +++ b/src/clingo/type/uint8.c @@ -24,8 +24,8 @@ extern inline bool uint64_to_uint8_c( uint64_t src, uint8_t dest[static 1] ); *******************************************************************************/ CMP_SLICE_C_( - cmp_uint8_slice_c, // FuncName - cUint8Slice, // SliceType + cmp_uint8s_c, // FuncName + cUint8s, // SliceType uint8_t const, // ValueType cmp_uint8_c, // CmpFunc do_deref_c_ // DoDeref @@ -33,7 +33,7 @@ CMP_SLICE_C_( COUNT_EQ_C_( count_eq_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t const, // ValueType uint8_t, // SearchType cmp_uint8_c, // CmpFunc @@ -42,7 +42,7 @@ COUNT_EQ_C_( FIND_VAL_C_( find_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t const, // ValueType uint8_t, // SearchType cmp_uint8_c, // CmpFunc @@ -51,7 +51,7 @@ FIND_VAL_C_( FIND_MAX_C_( max_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t const, // ValueType cmp_uint8_c, // CmpFunc do_deref_c_ // DoDeref @@ -59,7 +59,7 @@ FIND_MAX_C_( FIND_MIN_C_( min_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t const, // ValueType cmp_uint8_c, // CmpFunc do_deref_c_ // DoDeref @@ -67,35 +67,35 @@ FIND_MIN_C_( PROD_C_( prod_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t, // ValueType uint64_t, // ResType umul64_c // MulFunc ) QSORT_C_( - qsort_uint8_slice_c, // FuncName - cVarUint8Slice, // SliceType + qsort_uint8s_c, // FuncName + cVarUint8s, // SliceType uint8_t, // ValueType cmp_uint8_c, // CmpFunc do_deref_c_ // DoDeref ) REVERSE_C_( - reverse_uint8_slice_c, // FuncName - cVarUint8Slice, // SliceType + reverse_uint8s_c, // FuncName + cVarUint8s, // SliceType uint8_t // ValueType ) ROTATE_C_( - rotate_uint8_slice_c, // FuncName - cVarUint8Slice, // SliceType + rotate_uint8s_c, // FuncName + cVarUint8s, // SliceType uint8_t // ValueType ) SUM_C_( sum_uint8_c, // FuncName - cUint8Slice, // SliceType + cUint8s, // SliceType uint8_t, // ValueType uint64_t, // ResType uadd64_c // AddFunc diff --git a/test/_/algo/sum.c b/test/_/algo/sum.c index 5bbf2de..6cfd333 100644 --- a/test/_/algo/sum.c +++ b/test/_/algo/sum.c @@ -6,7 +6,7 @@ int main( void ) { init_tap_c_(); - cInt32Slice slice = slice_c_( int32_t, 50, 32, 123456, 99, -18, -65, 2 ); + cInt32s slice = slice_c_( int32_t, 50, 32, 123456, 99, -18, -65, 2 ); int64_t res = 0; expect_at_c_( sum_int32_c( slice, &res ) ); expect_at_c_( res == 123556 ); diff --git a/test/clingo/container/CInt64Vec/CInt64Vec-overview.c b/test/clingo/container/CInt64Vec/CInt64Vec-overview.c index 410b2aa..a5fbd7c 100644 --- a/test/clingo/container/CInt64Vec/CInt64Vec-overview.c +++ b/test/clingo/container/CInt64Vec/CInt64Vec-overview.c @@ -37,7 +37,7 @@ int main( void ) cRecorder* rec = &recorder_c_( 128 ); { - cInt64Slice slice = slice_of_int64_vec_c( vec ); + cInt64s slice = slice_of_int64_vec_c( vec ); each_c_( int64_t const*, i, slice ) { write_int64_c_( rec, *i ); diff --git a/test/clingo/container/map/benchmark-map.c b/test/clingo/container/map/benchmark-map.c index f4384c0..3653e51 100644 --- a/test/clingo/container/map/benchmark-map.c +++ b/test/clingo/container/map/benchmark-map.c @@ -45,7 +45,7 @@ cBenchmark* set_int64_map( int64_t n ) { static cBenchmark b = benchmark_c_( "set int64 map" ); - cVarInt64Slice ints = heap_slice_c_( n, int64_t ); + cVarInt64s ints = heap_slice_c_( n, int64_t ); srand( 123 ); times_c_( n, i ) { diff --git a/test/clingo/lang/algo/BSEARCH.c b/test/clingo/lang/algo/BSEARCH.c index 0d676a3..1c5c506 100644 --- a/test/clingo/lang/algo/BSEARCH.c +++ b/test/clingo/lang/algo/BSEARCH.c @@ -7,7 +7,7 @@ int main( void ) tap_note_c( "even slice test" ); { - cInt32Slice evenSlice = slice_c_( int32_t, + cInt32s evenSlice = slice_c_( int32_t, -30, -20, -10, 0, 10, 20, 30, 40 ); int32_t val = -30; @@ -21,7 +21,7 @@ int main( void ) tap_note_c( "odd slice test" ); { - cInt32Slice oddSlice = slice_c_( int32_t, -30, -20, -10, 0, 10, 20, 30 ); + cInt32s oddSlice = slice_c_( int32_t, -30, -20, -10, 0, 10, 20, 30 ); int32_t val = -30; for ( int64_t index = 0; index < oddSlice.s; ++index ) { diff --git a/test/clingo/lang/algo/FIND_MAX.c b/test/clingo/lang/algo/FIND_MAX.c index 5b607a6..cd2b854 100644 --- a/test/clingo/lang/algo/FIND_MAX.c +++ b/test/clingo/lang/algo/FIND_MAX.c @@ -5,7 +5,7 @@ int main( void ) { init_tap_c_(); - cInt32Slice slice = slice_c_( int32_t, 50, 123456, 99, 123456, -65 ); + cInt32s slice = slice_c_( int32_t, 50, 123456, 99, 123456, -65 ); int32_t const* max = max_int32_c( slice ); expect_at_c_( index_of_c_( slice, max ) == 1 ); diff --git a/test/clingo/lang/algo/FIND_MIN.c b/test/clingo/lang/algo/FIND_MIN.c index 5b5716a..f42d22c 100644 --- a/test/clingo/lang/algo/FIND_MIN.c +++ b/test/clingo/lang/algo/FIND_MIN.c @@ -5,7 +5,7 @@ int main( void ) { init_tap_c_(); - cUint32Slice slice = slice_c_( uint32_t, 123456, 5648, 658, 79456, 658 ); + cUint32s slice = slice_c_( uint32_t, 123456, 5648, 658, 79456, 658 ); uint32_t const* min = min_uint32_c( slice ); expect_at_c_( index_of_c_( slice, min ) == 2 ); diff --git a/test/clingo/lang/slice/left.c b/test/clingo/lang/slice/left.c index 2e4724c..4fa6ac8 100644 --- a/test/clingo/lang/slice/left.c +++ b/test/clingo/lang/slice/left.c @@ -1,7 +1,7 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" #include "clingo/type/cChars.h" -#include "clingo/type/int64.h" // for cInt64Slice +#include "clingo/type/int64.h" // for cInt64s int main( void ) { @@ -19,10 +19,10 @@ int main( void ) cChars empty = left_c_( cChars, chars, 0 ); expect_at_c_( is_empty_c_( empty ) ); - // -------------------------------------------------------------- cInt64Slice - cInt64Slice int64s = slice_c_( int64_t, 123, -456, 789, 369, 246 ); + // -------------------------------------------------------------- cInt64s + cInt64s int64s = slice_c_( int64_t, 123, -456, 789, 369, 246 ); - cInt64Slice three = left_c_( cInt64Slice, int64s, 3 ); + cInt64s three = left_c_( cInt64s, int64s, 3 ); expect_at_c_( three.s == 3 ); expect_at_c_( three.v[ 0 ] == 123 ); expect_at_c_( three.v[ 2 ] == 789 ); diff --git a/test/clingo/lang/slice/mid.c b/test/clingo/lang/slice/mid.c index 17f7126..6273fc2 100644 --- a/test/clingo/lang/slice/mid.c +++ b/test/clingo/lang/slice/mid.c @@ -1,7 +1,7 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" #include "clingo/type/cChars.h" -#include "clingo/type/int16.h" // for cInt16Slice +#include "clingo/type/int16.h" // for cInt16s int main( void ) { @@ -19,10 +19,10 @@ int main( void ) cChars nullSlice = mid_c_( cChars, chars, chars.s ); expect_at_c_( is_empty_c_( nullSlice ) ); - // -------------------------------------------------------------- cInt16Slice - cInt16Slice int16s = slice_c_( int16_t, 8, -16, 128, -1024, 512 ); + // -------------------------------------------------------------- cInt16s + cInt16s int16s = slice_c_( int16_t, 8, -16, 128, -1024, 512 ); - cInt16Slice two = mid_c_( cInt16Slice, int16s, 3 ); + cInt16s two = mid_c_( cInt16s, int16s, 3 ); expect_at_c_( two.s == 2 ); expect_at_c_( two.v[ 0 ] == -1024 ); expect_at_c_( two.v[ 1 ] == 512 ); diff --git a/test/clingo/lang/slice/right.c b/test/clingo/lang/slice/right.c index dcfc3eb..909d984 100644 --- a/test/clingo/lang/slice/right.c +++ b/test/clingo/lang/slice/right.c @@ -1,7 +1,7 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" #include "clingo/type/cChars.h" -#include "clingo/type/int8.h" // for cInt8Slice +#include "clingo/type/int8.h" // for cInt8s int main( void ) { @@ -19,10 +19,10 @@ int main( void ) cChars empty = right_c_( cChars, chars, 0 ); expect_at_c_( is_empty_c_( empty ) ); - // --------------------------------------------------------------- cInt8Slice - cInt8Slice int8s = slice_c_( int8_t, 8, 27, -99, 23, 77, 80, -111 ); + // --------------------------------------------------------------- cInt8s + cInt8s int8s = slice_c_( int8_t, 8, 27, -99, 23, 77, 80, -111 ); - cInt8Slice four = right_c_( cInt8Slice, int8s, 4 ); + cInt8s four = right_c_( cInt8s, int8s, 4 ); expect_at_c_( four.s == 4 ); expect_at_c_( four.v[ 0 ] == 23 ); expect_at_c_( four.v[ 3 ] == -111 ); diff --git a/test/clingo/lang/slice/scalars.c b/test/clingo/lang/slice/scalars.c index f8f23b7..e7b70c9 100644 --- a/test/clingo/lang/slice/scalars.c +++ b/test/clingo/lang/slice/scalars.c @@ -1,12 +1,12 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" -#include "clingo/type/int64.h" // for cInt64Slice +#include "clingo/type/int64.h" // for cInt64s int main( void ) { init_tap_c_(); - cVarInt64Slice slice = scalars_c_( 3, int64_t ); + cVarInt64s slice = scalars_c_( 3, int64_t ); slice.v[ 0 ] = -10; slice.v[ 1 ] = 100; slice.v[ 2 ] = 200; diff --git a/test/clingo/lang/slice/set_if.c b/test/clingo/lang/slice/set_if.c index 4817390..6f0d4ac 100644 --- a/test/clingo/lang/slice/set_if.c +++ b/test/clingo/lang/slice/set_if.c @@ -1,13 +1,13 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" -#include "clingo/type/int64.h" // for cInt64Slice +#include "clingo/type/int64.h" // for cInt64s int main( void ) { init_tap_c_(); - cVarInt64Slice slice4 = slice_c_( int64_t, 11, 22, 33, 44 ); - cVarInt64Slice slice3 = left_c_( cVarInt64Slice, slice4, 3 ); + cVarInt64s slice4 = slice_c_( int64_t, 11, 22, 33, 44 ); + cVarInt64s slice3 = left_c_( cVarInt64s, slice4, 3 ); set_if_c_( slice3, 0, 10 ); set_if_c_( slice3, 1, 20 ); set_if_c_( slice3, 2, 30 ); diff --git a/test/clingo/lang/slice/sub.c b/test/clingo/lang/slice/sub.c index 60b715c..020cfcc 100644 --- a/test/clingo/lang/slice/sub.c +++ b/test/clingo/lang/slice/sub.c @@ -1,7 +1,7 @@ #include "clingo/lang/expect.h" #include "clingo/lang/slice.h" #include "clingo/type/cChars.h" -#include "clingo/type/int32.h" // for cInt16Slice +#include "clingo/type/int32.h" // for cInt16s int main( void ) { @@ -19,15 +19,15 @@ int main( void ) cChars emptyChars = sub_c_( cChars, chars, 6, 16 ); expect_at_c_( is_empty_c_( emptyChars ) ); - // -------------------------------------------------------------- cInt32Slice - cInt32Slice int32s = slice_c_( int32_t, -123, 4356, 876, -3, 98676 ); + // -------------------------------------------------------------- cInt32s + cInt32s int32s = slice_c_( int32_t, -123, 4356, 876, -3, 98676 ); - cInt32Slice three = sub_c_( cInt32Slice, int32s, 1, 4 ); + cInt32s three = sub_c_( cInt32s, int32s, 1, 4 ); expect_at_c_( three.s == 3 ); expect_at_c_( three.v[ 0 ] == 4356 ); expect_at_c_( three.v[ 2 ] == -3 ); - cInt32Slice one = sub_c_( cInt32Slice, int32s, 2, 3 ); + cInt32s one = sub_c_( cInt32s, int32s, 2, 3 ); expect_at_c_( one.s == 1 ); expect_at_c_( one.v[ 0 ] == 876 );