Pages: 1
Author Topic: Laziness Buffer  (35,922 Views)
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Posted on: October 15, 2011, 09:20:27 PM
typedef signed char byte;
typedef unsigned char ubyte;
typedef signed char schar;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef long long llong;
typedef unsigned long long ullong;
Offline (Unknown gender) luiscubal

Member
Joined: Jun 2009
Posts: 452
View profile
Reply #1 Posted on: October 15, 2011, 09:42:36 PM
Quotetypedef signed char byte;
typedef unsigned char ubyte;
Oh, no you didn't.

byte is(as of newest standards) required to be at least 8 bits, but not necessarily.
For precise sizes, see <stdint.h>(which does include int8_t and uint8_t)

Also, some languages(e.g. C#) have "byte" unsigned, and then have "sbyte", which is signed.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #2 Posted on: October 15, 2011, 09:49:39 PM
Quote from: luiscubal on October 15, 2011, 09:42:36 PM
Quotetypedef signed char byte;
typedef unsigned char ubyte;
Oh, no you didn't.

byte is(as of newest standards) required to be at least 8 bits, but not necessarily.
For precise sizes, see <stdint.h>(which does include int8_t and uint8_t)

Also, some languages(e.g. C#) have "byte" unsigned, and then have "sbyte", which is signed.
Quotelaziness buffer

Also, I probably would swap those two.
Pages: 1