|
From: <kin...@us...> - 2003-12-21 02:42:53
|
Update of /cvsroot/teem/teem/src/air
In directory sc8-pr-cvs1:/tmp/cvs-serv5464/air
Modified Files:
air.h
Log Message:
Nixed the AIR_MEMCPY macros because they were not being used by anyone. Yet more changes and re-arrangements for NrrdIO
Index: air.h
===================================================================
RCS file: /cvsroot/teem/teem/src/air/air.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** air.h 19 Dec 2003 22:32:24 -0000 1.32
--- air.h 21 Dec 2003 02:42:50 -0000 1.33
***************
*** 41,48 ****
--- 41,52 ----
#ifdef _WIN32
#if _MSC_VER < 1300 || !defined(_USE_MATH_DEFINES)
+ #ifndef M_PI
#define M_PI 3.14159265358979323846
+ #endif
+ #ifndef M_E
#define M_E 2.71828182845904523536
#endif
#endif
+ #endif
#if defined(_WIN32) && !defined(__CYGWIN__)
***************
*** 373,382 ****
extern air_export const char *airTeemVersion;
extern air_export const char *airTeemReleaseDate;
- extern air_export const char airMyFmt_size_t[];
- extern air_export const int airMy32Bit;
- extern void airSrand(void);
- extern double airRand(void);
- extern int airRandInt(int N);
- extern void airShuffle(int *buff, int N, int perm);
extern void *airNull(void);
extern void *airSetNull(void **ptrP);
--- 377,380 ----
***************
*** 385,388 ****
--- 383,394 ----
extern FILE *airFopen(const char *name, FILE *std, const char *mode);
extern FILE *airFclose(FILE *file);
+ extern int airSinglePrintf(FILE *file, char *str, const char *fmt, ...);
+ extern air_export const int airMy32Bit;
+ /* ---- BEGIN non-NrrdIO */
+ extern air_export const char airMyFmt_size_t[];
+ extern void airSrand(void);
+ extern double airRand(void);
+ extern int airRandInt(int N);
+ extern void airShuffle(int *buff, int N, int perm);
extern char *airDoneStr(float start, float here, float end, char *str);
extern double airTime();
***************
*** 391,395 ****
extern int airSgn(double);
extern int airLog2(float n);
- extern int airSinglePrintf(FILE *file, char *str, const char *fmt, ...);
extern void airBinaryPrintUInt(FILE *file, int digits, unsigned int N);
extern double airErf(double x);
--- 397,400 ----
***************
*** 403,406 ****
--- 408,412 ----
extern float airFStore(void *v, int t, float f);
extern double airDStore(void *v, int t, double d);
+ /* ---- END non-NrrdIO */
/* dio.c */
***************
*** 780,815 ****
# endif
#endif
-
- /*
- ******** AIR_MEMCPY1, AIR_MEMCPY2, AIR_MEMCPY4, AIR_MEMCPY8, AIR_MEMCPY
- **
- ** THESE ARE NOT GENERALY PURPOSE memcpy() REPLACEMENTS!
- **
- ** They offer a speed-up over memcpy() by eliminating calls to in on
- ** very small lengths of memory, BUT ONLY when the addresses involved
- ** are a multiple of the number of bytes to be copied.
- ** AIR_MEMCPY{1,2,4,8} will (like memcpy) return the first argument, but
- ** AIR_MEMCPY does not.
- **
- ** Using these macros is, more than other macros, playing with fire!
- ** You can very very easily get a (fatal) bus error by trying to
- ** dereference a pointer as say, an int, just because 4 bytes need to
- ** be copied, even when the pointer has nothing to do with ints, and
- ** is therefore holding an address which is NOT a multiple of four.
- ** Hence the warnings above.
- */
- #define AIR_MEMCPY1(a, b) (*((char*)(a)) = *((char*)(b)))
- #define AIR_MEMCPY2(a, b) (*((short*)(a)) = *((short*)(b)))
- #define AIR_MEMCPY4(a, b) (*((int*)(a)) = *((int*)(b)))
- #define AIR_MEMCPY8(a, b) (*((long long*)(a)) = *((long long*)(b)))
- #define AIR_MEMCPY(a, b, sz) \
- switch (sz) { \
- case 1: AIR_MEMCPY1(a, b); break; \
- case 2: AIR_MEMCPY2(a, b); break; \
- case 4: AIR_MEMCPY4(a, b); break; \
- case 8: AIR_MEMCPY8(a, b); break; \
- default: memcpy((a), (b), (sz)); break; \
- }
-
#ifdef __cplusplus
--- 786,789 ----
|