diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-21 08:53:29 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-21 08:53:29 +0900 |
| commit | 5f846923675fca5a931d6a317078e34e880d11a5 (patch) | |
| tree | ddf7eae18acb23ed8b064336ca6d756b1ef51a0a /src | |
| parent | 73c86f59f61fdb1c240b48d175ecef0a86e484c6 (diff) | |
| parent | 81308c0bf4864986a00d2fa60ef919db6c1593e0 (diff) | |
| download | mruby-5f846923675fca5a931d6a317078e34e880d11a5.tar.gz mruby-5f846923675fca5a931d6a317078e34e880d11a5.zip | |
Merge pull request #2095 from suzukaze/refactor-dump.c
Use boolean macro in is_valid_c_symbol_name()
Diffstat (limited to 'src')
| -rw-r--r-- | src/dump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dump.c b/src/dump.c index 2691aab3d..e3d1b779f 100644 --- a/src/dump.c +++ b/src/dump.c @@ -831,20 +831,20 @@ mrb_dump_irep_binary(mrb_state *mrb, mrb_irep *irep, int debug_info, FILE* fp) return result; } -static int +static mrb_bool is_valid_c_symbol_name(const char *name) { const char *c = NULL; - if (name == NULL || name[0] == '\0') return 0; - if (!ISALPHA(name[0]) && name[0] != '_') return 0; + if (name == NULL || name[0] == '\0') return FALSE; + if (!ISALPHA(name[0]) && name[0] != '_') return FALSE; c = &name[1]; for (; *c != '\0'; ++c) { - if (!ISALNUM(*c) && *c != '_') return 0; + if (!ISALNUM(*c) && *c != '_') return FALSE; } - return 1; + return TRUE; } int |
