diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-31 20:51:11 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-31 20:51:11 +0200 |
commit | a89bd16ff78c74513461af3f676d87d4eb9cfd3c (patch) | |
tree | 25977f27d837e3713b52e056f533bcbaba8a4597 /debug.c | |
parent | a32faf6354086864b55755c968f72a90e7e8f0d1 (diff) | |
download | egawk-a89bd16ff78c74513461af3f676d87d4eb9cfd3c.tar.gz egawk-a89bd16ff78c74513461af3f676d87d4eb9cfd3c.tar.bz2 egawk-a89bd16ff78c74513461af3f676d87d4eb9cfd3c.zip |
Remove ancient STREQ, STREQN macros.
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -994,7 +994,7 @@ find_param(const char *name, long num, char **pname) pcount = get_param_count(func); for (i = 0; i < pcount; i++) { - if (STREQ(name, pnames[i])) { + if (strcmp(name, pnames[i]) == 0) { r = f->stack[i]; if (r->type == Node_array_ref) r = r->orig_array; @@ -4068,7 +4068,7 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) */ if (strlen(line) > 1 - && STREQN(line, "sa", 2)) + && strncmp(line, "sa", 2) == 0) continue; fprintf(fp, "%s\n", line); @@ -4102,7 +4102,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) value = arg ? arg->a_string : NULL; for (opt = option_list; opt->name; opt++) { /* linear search */ - if (STREQ(name, opt->name)) + if (strcmp(name, opt->name) == 0) break; } if (! opt->name) @@ -4651,8 +4651,9 @@ unserialize_option(char **pstr, int *pstr_len, int field_cnt ATTRIBUTE_UNUSED) const struct dbg_option *opt; for (opt = option_list; opt->name; opt++) { - if (STREQN(pstr[0], opt->name, pstr_len[0])) { + if (strncmp(pstr[0], opt->name, pstr_len[0]) == 0) { char *value; + value = estrdup(pstr[1], pstr_len[1]); (*(opt->assign))(value); efree(value); @@ -5063,7 +5064,7 @@ find_option(char *name) int idx; for (idx = 0; (p = option_list[idx].name); idx++) { - if (STREQ(p, name)) + if (strcmp(p, name) == 0) return idx; } return -1; @@ -5132,19 +5133,19 @@ set_gawk_output(const char *file) if (fp == NULL) close(fd); - } else if (STREQN(file, "/dev/", 5)) { + } else if (strncmp(file, "/dev/", 5) == 0) { char *cp = (char *) file + 5; - if (STREQ(cp, "stdout")) + if (strcmp(cp, "stdout") == 0) return; - if (STREQ(cp, "stderr")) { + if (strcmp(cp, "stderr") == 0) { output_fp = stderr; output_file = "/dev/stderr"; output_is_tty = os_isatty(fileno(stderr)); return; } - if (STREQN(cp, "fd/", 3)) { + if (strncmp(cp, "fd/", 3) == 0) { cp += 3; fd = (int) strtoul(cp, NULL, 10); if (errno == 0 && fd > INVALID_HANDLE) { @@ -5198,9 +5199,9 @@ static int set_option_flag(const char *value) { long n; - if (STREQ(value, "on")) + if (strcmp(value, "on") == 0) return TRUE; - if (STREQ(value, "off")) + if (strcmp(value, "off") == 0) return FALSE; errno = 0; n = strtol(value, NULL, 0); @@ -5703,7 +5704,7 @@ in_cmd_src(const char *filename) { struct command_source *cs; for (cs = cmd_src; cs != NULL; cs = cs->next) { - if (cs->str != NULL && STREQ(cs->str, filename)) + if (cs->str != NULL && strcmp(cs->str, filename) == 0) return TRUE; } return FALSE; |