Category : C Source Code
Archive   : NIH.ZIP
Filename : OOPSCONF.H

 
Output of file : OOPSCONF.H contained in archive : NIH.ZIP
#ifndef OOPSCONFIG_H
#define OOPSCONFIG_H

inline unsigned mod_sizeof_short(unsigned i) {
return sizeof(short)&sizeof(short)-1 ? i%sizeof(short) : i&sizeof(short)-1; }
inline unsigned mod_sizeof_int(unsigned i) {
return sizeof(int)&sizeof(int)-1 ? i%sizeof(int) : i&sizeof(int)-1; }
inline unsigned mod_sizeof_long(unsigned i) {
return sizeof(long)&sizeof(long)-1 ? i%sizeof(long) : i&sizeof(long)-1; }
inline unsigned mod_sizeof_float(unsigned i) {
return sizeof(float)&sizeof(float)-1 ? i%sizeof(float) : i&sizeof(float)-1; }
inline unsigned mod_sizeof_double(unsigned i) {
return sizeof(double)&sizeof(double)-1 ? i%sizeof(double) : i&sizeof(double)-1; }
inline unsigned mod_sizeof_ptr(unsigned i) {
return sizeof(void*)&sizeof(void*)-1 ? i%sizeof(void*) : i&sizeof(void*)-1; }


//constants relating size of types to size of char (byte)

inline unsigned div_bitsize_char(unsigned i) { return i >> 3; }
inline unsigned mod_bitsize_char(unsigned i) { return i & 7; }
inline unsigned div_sizeof_short(unsigned i) { return i >> 1; }

// 16 bit machine
inline unsigned div_sizeof_int(unsigned i) { return i >> 1; }
inline unsigned div_sizeof_ptr(unsigned i) { return i >> 1; }
//inline unsigned div_sizeof_ptr(unsigned i) { return i >> 2; }
//inline unsigned div_sizeof_int(unsigned i) { return i >> 2; }

inline unsigned div_sizeof_long(unsigned i) { return i >> 2; }
inline unsigned div_sizeof_float(unsigned i) { return i >> 2; }
inline unsigned div_sizeof_double(unsigned i) { return i >> 3; }

const int UNINITIALIZED =0xCCCC; // data value to flag uninitialized variables

// Pseudo-random number generator
const int MAX_INT = 0x7fff;
inline int DRAW(long& x) { return (x = x*1103515245 + 12345) & MAX_INT; }

#define STACK_GROWS_DOWN 1

#endif


  3 Responses to “Category : C Source Code
Archive   : NIH.ZIP
Filename : OOPSCONF.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/