Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 6 additions & 45 deletions src/integer64.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
# Header-Code
# S3 atomic 64bit integers for R
# (c) 2011 Jens Oehlschägel
# (c) 2011-2024 Jens Oehlschägel
# (c) 2025-2026 Michael Chirico
# Licence: GPL2
# Provided 'as is', use at your own risk
# Created: 2011-12-11
# Last changed: 2011-12-11
#*/


Expand Down Expand Up @@ -37,17 +36,11 @@
#define NCHARS_BITS_INTEGER64 65
#define NCHARS_DECS_INTEGER64 22
#define COERCE_INTEGER64 "%lli"
#define USES_TWOS_COMPLEMENT 1
#define BITS_INTEGER64 64

#if USES_TWOS_COMPLEMENT
# define OPPOSITE_SIGNS(x, y) ((x < 0) ^ (y < 0))
# define GOODISUM64(x, y, z) (((x) > 0) ? ((y) < (z)) : ! ((y) < (z)))
# define GOODIDIFF64(x, y, z) (!(OPPOSITE_SIGNS(x, y) && OPPOSITE_SIGNS(x, z)))
#else
# define GOODISUM64(x, y, z) ((long double) (x) + (long double) (y) == (z))
# define GOODIDIFF64(x, y, z) ((long double) (x) - (long double) (y) == (z))
#endif
#define OPPOSITE_SIGNS(x, y) ((x < 0) ^ (y < 0))
#define GOODISUM64(x, y, z) (((x) > 0) ? ((y) < (z)) : ! ((y) < (z)))
#define GOODIDIFF64(x, y, z) (!(OPPOSITE_SIGNS(x, y) && OPPOSITE_SIGNS(x, z)))
#define GOODIPROD64(x, y, z) ((long double) (x) * (long double) (y) == (z))
#define INTEGER32_OVERFLOW_WARNING "NAs produced by integer overflow"
#define INTEGER64_OVERFLOW_WARNING "NAs produced by integer64 overflow"
Expand Down Expand Up @@ -324,36 +317,4 @@ else { \
ret = (e1 >= e2) ? TRUE : FALSE; \
}


/*****************************************************************************/
/** **/
/** TYPEDEFS AND STRUCTURES **/
/** **/
/*****************************************************************************/

/*****************************************************************************/
/** **/
/** EXPORTED VARIABLES **/
/** **/
/*****************************************************************************/


#ifndef _INTEGER64_C_SRC

#endif

/*****************************************************************************/
/** **/
/** EXPORTED FUNCTIONS **/
/** **/
/*****************************************************************************/


#endif

/*****************************************************************************/
/** **/
/** EOF **/
/** **/
/*****************************************************************************/

#endif // _INTEGER64_INLCUDED
18 changes: 2 additions & 16 deletions src/sort64.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
# C-Header for sorting and ordering
# S3 atomic 64bit integers for R
# (c) 2011, 2012 Jens Oehlschägel
# (c) 2011-2024 Jens Oehlschägel
# (c) 2025-2026 Michael Chirico
# Licence: GPL2
# Provided 'as is', use at your own risk
# Created: 2011-12-11
# Last changed: 2012-10-03
*/


Expand Down Expand Up @@ -41,19 +40,6 @@
// #define DEBUG_RETURN move_counter;
#define DEBUG_DONE Rprintf("compare_counter=%d move_counter=%d\n", compare_counter, move_counter); R_FlushConsole(); //doneTicks();

#if defined(WIN32) || defined(WIN64) || defined(_WIN32_) || defined(_WIN64_) || defined(__WIN32__) || defined(__WIN64__)
#define MULTI_THREADING 0
#else
#define MULTI_THREADING 1
#endif

#if MULTI_THREADING
#include <pthread.h>
#endif

// dummy for counting comp ops
#define COUNTLESS

#define LESS(A,B) ((A)<(B))
#define GREATER(A, B) LESS((B), (A))

Expand Down
Loading