pack.c: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ecb959bd8b
commit
6a6d03791b
34
pack.c
34
pack.c
@ -42,20 +42,20 @@ static const char endstr[] = "sSiIlLqQjJ";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DYNAMIC_ENDIAN
|
#ifdef DYNAMIC_ENDIAN
|
||||||
/* for universal binary of NEXTSTEP and MacOS X */
|
/* for universal binary of NEXTSTEP and MacOS X */
|
||||||
/* useless since autoconf 2.63? */
|
/* useless since autoconf 2.63? */
|
||||||
static int
|
static int
|
||||||
is_bigendian(void)
|
is_bigendian(void)
|
||||||
{
|
{
|
||||||
static int init = 0;
|
static int init = 0;
|
||||||
static int endian_value;
|
static int endian_value;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (init) return endian_value;
|
if (init) return endian_value;
|
||||||
init = 1;
|
init = 1;
|
||||||
p = (char*)&init;
|
p = (char*)&init;
|
||||||
return endian_value = p[0]?0:1;
|
return endian_value = p[0]?0:1;
|
||||||
}
|
}
|
||||||
# define BIGENDIAN_P() (is_bigendian())
|
# define BIGENDIAN_P() (is_bigendian())
|
||||||
#elif defined(WORDS_BIGENDIAN)
|
#elif defined(WORDS_BIGENDIAN)
|
||||||
# define BIGENDIAN_P() 1
|
# define BIGENDIAN_P() 1
|
||||||
@ -839,9 +839,9 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
|
|||||||
|
|
||||||
cp = RSTRING_PTR(buf);
|
cp = RSTRING_PTR(buf);
|
||||||
while (1 < numbytes) {
|
while (1 < numbytes) {
|
||||||
*cp |= 0x80;
|
*cp |= 0x80;
|
||||||
cp++;
|
cp++;
|
||||||
numbytes--;
|
numbytes--;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_str_buf_cat(res, RSTRING_PTR(buf), RSTRING_LEN(buf));
|
rb_str_buf_cat(res, RSTRING_PTR(buf), RSTRING_LEN(buf));
|
||||||
@ -1005,7 +1005,7 @@ hex2num(char c)
|
|||||||
tmp_len = 0; \
|
tmp_len = 0; \
|
||||||
if (len > (long)((send-s)/(sz))) { \
|
if (len > (long)((send-s)/(sz))) { \
|
||||||
if (!star) { \
|
if (!star) { \
|
||||||
tmp_len = len-(send-s)/(sz); \
|
tmp_len = len-(send-s)/(sz); \
|
||||||
} \
|
} \
|
||||||
len = (send-s)/(sz); \
|
len = (send-s)/(sz); \
|
||||||
} \
|
} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user