diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-05-18 04:56:27 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-05-18 04:56:27 +0000 |
commit | 32dc42cf1a248821df7594047bd3fd7822622b32 (patch) | |
tree | b44992897e705edbaec22a2c5e4aee402c5d5177 /pack.c | |
parent | ec6b316cf26eae7eb36e3f9bce24110319e33e35 (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -11,8 +11,8 @@ ************************************************/ #include "ruby.h" -#include <ctype.h> #include <sys/types.h> +#include <ctype.h> #define swaps(x) ((((x)&0xFF)<<8) + (((x)>>8)&0xFF)) #define swapl(x) ((((x)&0xFF)<<24) \ @@ -75,13 +75,10 @@ endian() #endif extern VALUE cString, cArray; -#ifndef atof -double atof(); -#endif static char *toofew = "too few arguments"; -static void encodes(); +static void encodes _((VALUE,char*,int,int)); static void pack_add_ptr(str, add) @@ -126,7 +123,7 @@ pack_pack(ary, fmt) len = strchr("@Xxu", type) ? 0 : items; p++; } - else if (isdigit(*p)) { + else if (ISDIGIT(*p)) { len = strtoul(p, (char**)&p, 10); } else { @@ -222,8 +219,8 @@ pack_pack(ary, fmt) int i; for (i=0; i++ < len; ptr++) { - if (isxdigit(*ptr)) { - if (isalpha(*ptr)) + if (ISXDIGIT(*ptr)) { + if (ISALPHA(*ptr)) byte |= (((*ptr & 15) + 9) & 15) << 4; else byte |= (*ptr & 15) << 4; @@ -249,8 +246,8 @@ pack_pack(ary, fmt) int i; for (i=0; i++ < len; ptr++) { - if (isxdigit(*ptr)) { - if (isalpha(*ptr)) + if (ISXDIGIT(*ptr)) { + if (ISALPHA(*ptr)) byte |= ((*ptr & 15) + 9) & 15; else byte |= *ptr & 15; @@ -570,7 +567,7 @@ pack_unpack(str, fmt) len = send - s; p++; } - else if (isdigit(*p)) { + else if (ISDIGIT(*p)) { len = strtoul(p, (char**)&p, 10); } else { |