diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-04 05:41:05 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-07-04 05:41:05 +0300 |
commit | 414cd1eccff2d6d6415e1f65ac2e51e7c1b33890 (patch) | |
tree | ec23aa620134a1c949840c1c9e3294ba89a83a43 /array.c | |
parent | 093f27aa0d53494c257cf16a57b01ad43f70cdff (diff) | |
parent | ff4e0706c5ee5dffd69168ebd0ff5f53e474d048 (diff) | |
download | egawk-414cd1eccff2d6d6415e1f65ac2e51e7c1b33890.tar.gz egawk-414cd1eccff2d6d6415e1f65ac2e51e7c1b33890.tar.bz2 egawk-414cd1eccff2d6d6415e1f65ac2e51e7c1b33890.zip |
Merge branch 'master' into feature/cmake
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -704,7 +704,14 @@ value_info(NODE *n) if ((n->flags & (STRING|STRCUR)) == STRCUR) { fprintf(output_fp, "]["); fprintf(output_fp, "stfmt=%d, ", n->stfmt); - fprintf(output_fp, "CONVFMT=\"%s\"", n->stfmt <= -1 ? "<unused>" + /* + * If not STFMT_UNUSED, could be CONVFMT or OFMT if last + * used in a print statement. If immutable, could be that it + * was originally set as a string, or it's a number that has + * an integer value. + */ + fprintf(output_fp, "FMT=\"%s\"", + n->stfmt == STFMT_UNUSED ? "<unused>" : fmt_list[n->stfmt]->stptr); } @@ -1157,17 +1164,8 @@ sort_up_value_type(const void *p1, const void *p2) } /* two scalars */ - /* 2. Resolve MAYBE_NUM, so that have only NUMBER or STRING */ - if ((n1->flags & MAYBE_NUM) != 0) - (void) force_number(n1); - if ((n2->flags & MAYBE_NUM) != 0) - (void) force_number(n2); - - /* 2.5. Resolve INTIND, so that is STRING, and not NUMBER */ - if ((n1->flags & INTIND) != 0) - (void) force_string(n1); - if ((n2->flags & INTIND) != 0) - (void) force_string(n2); + (void) fixtype(n1); + (void) fixtype(n2); if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) { return cmp_numbers(n1, n2); |