From 5669377a571b992a25c4ee98c7685e8c7d4c6ec0 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 1 Jul 2008 08:44:32 +0000 Subject: * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond), thread.c (eKillSignal, eTerminateSignal), missing/vsnprintf.c (BSD_vfprintf): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ iseq.c | 2 +- missing/vsnprintf.c | 4 ++-- thread.c | 4 ++-- time.c | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b88ac30502..9630a6034b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 1 17:44:30 2008 Nobuyoshi Nakada + + * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond), + thread.c (eKillSignal, eTerminateSignal), + missing/vsnprintf.c (BSD_vfprintf): constified. + Tue Jul 1 17:37:43 2008 URABE Shyouhei * enc/ascii.c: ISO C does not allow extra ';' outside of a diff --git a/iseq.c b/iseq.c index 24d15575e9..b2a3237f0b 100644 --- a/iseq.c +++ b/iseq.c @@ -219,7 +219,7 @@ static rb_compile_option_t COMPILE_OPTION_DEFAULT = { OPT_STACK_CACHING, /* int stack_caching; */ OPT_TRACE_INSTRUCTION, /* int trace_instruction */ }; -static const rb_compile_option_t COMPILE_OPTION_FALSE; +static const rb_compile_option_t COMPILE_OPTION_FALSE = {0}; static void make_compile_option(rb_compile_option_t *option, VALUE opt) diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c index dfa0348446..d7545fdf26 100644 --- a/missing/vsnprintf.c +++ b/missing/vsnprintf.c @@ -564,9 +564,9 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap) * below longer. */ #define PADSIZE 16 /* pad chunk size */ - static char blanks[PADSIZE] = + static const char blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static char zeroes[PADSIZE] = + static const char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; /* diff --git a/thread.c b/thread.c index 13630b6b02..10c4e3ea73 100644 --- a/thread.c +++ b/thread.c @@ -68,8 +68,8 @@ static void rb_check_deadlock(rb_vm_t *vm); void rb_signal_exec(rb_thread_t *th, int sig); void rb_disable_interrupt(void); -static VALUE eKillSignal = INT2FIX(0); -static VALUE eTerminateSignal = INT2FIX(1); +static const VALUE eKillSignal = INT2FIX(0); +static const VALUE eTerminateSignal = INT2FIX(1); static volatile int system_working = 1; inline static void diff --git a/time.c b/time.c index 08f4eb8282..fdf465ceb8 100644 --- a/time.c +++ b/time.c @@ -494,7 +494,7 @@ leap_year_p(long y) static time_t timegm_noleapsecond(struct tm *tm) { - static int common_year_yday_offset[] = { + static const int common_year_yday_offset[] = { -1, -1 + 31, -1 + 31 + 28, @@ -509,7 +509,7 @@ timegm_noleapsecond(struct tm *tm) -1 + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 /* 1 2 3 4 5 6 7 8 9 10 11 */ }; - static int leap_year_yday_offset[] = { + static const int leap_year_yday_offset[] = { -1, -1 + 31, -1 + 31 + 29, -- cgit v1.2.3