Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pfpu command: print results always as hex dump and as floats

Before, main_pfpu tried to be a bit too smart and made the output
format follow the input format. More often than not, this turned
out to be inconvenient. Now we just print both - let the user
sort them out.
  • Loading branch information...
commit 57592ac11e6bb0a3fc5772eb76a806fbfe7685ba 1 parent 73bc649
@wpwrak wpwrak authored
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/shellext.c
View
10 src/shellext.c
@@ -179,7 +179,6 @@ static int main_pfpu(int argc, char **argv)
};
char **arg;
float *r = regs+PFPU_SPREG_COUNT, *rr;
- int hex = 0;
int fd, res;
for(arg = argv+1; arg != argv+argc; arg++) {
@@ -188,7 +187,6 @@ static int main_pfpu(int argc, char **argv)
} else if(!strncmp(*arg, "0x", 2)) {
u.i = strtoul(*arg, NULL, 0);
*r++ = u.f;
- hex = 1;
} else if(strlen(*arg) == 8) {
program[td.progsize++] = strtoul(*arg, NULL, 16);
} else {
@@ -213,12 +211,8 @@ static int main_pfpu(int argc, char **argv)
for(rr = regs+PFPU_SPREG_COUNT; r != rr; rr++) {
if(rr != regs+PFPU_SPREG_COUNT)
putchar(' ');
- if(hex) {
- u.f = *rr;
- printf("0x%08x", u.i);
- } else {
- printf("%g", *rr);
- }
+ u.f = *rr;
+ printf("0x%08x %g", u.i, *rr);
}
putchar('\n');
Please sign in to comment.
Something went wrong with that request. Please try again.