Skip to content

Commit

Permalink
refactor: remove unused variable, hide unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kg68k committed Nov 27, 2024
1 parent 1a2722b commit ee82792
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 12 additions & 10 deletions src/fpconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@ static ExtendedReal* alignExtendedReal(codeptr valp, ExtendedReal* buf) {
return isodd(valp) ? memcpy(buf, valp, sizeof(*buf)) : (ExtendedReal*)valp;
}

static long double peekExtended(ExtendedReal* xr) {
#ifdef __BIG_ENDIAN__
return *(long double*)xr;
#else
ExtendedReal le = {
.ul = {peeklv(xr->ul[2]), peeklv(xr->ul[1]), peeklv(xr->ul[0]) >> 16, 0}};
return *(long double*)≤
#endif
}

static boolean is_normalized_x(ExtendedReal* xr) {
ULONG ul0 = peeklv(xr->ul[0]);
UWORD e = (ul0 >> 16) & 0x7fff;
Expand All @@ -151,6 +141,17 @@ static char* fpconv_x_inreal(char* buf, ExtendedReal* xr) {
return itox8_without_0supress(buf, peeklv(xr->ul[2]));
}

#ifndef NO_PRINTF_LDBL
static long double peekExtended(ExtendedReal* xr) {
#ifdef __BIG_ENDIAN__
return *(long double*)xr;
#else
ExtendedReal le = {
.ul = {peeklv(xr->ul[2]), peeklv(xr->ul[1]), peeklv(xr->ul[0]) >> 16, 0}};
return *(long double*)≤
#endif
}

static inline char* fpconv_x_printf(char* buf, ExtendedReal* xr) {
char* p = buf + sprintf(buf, "0f%.30Lg", peekExtended(xr));

Expand All @@ -166,6 +167,7 @@ static inline char* fpconv_x_printf(char* buf, ExtendedReal* xr) {

return p;
}
#endif

// Extended-Precision Real 文字列化
char* fpconv_x(char* buf, codeptr valp) {
Expand Down
6 changes: 2 additions & 4 deletions src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ static void dataout(address pc, ULONG bytes, opesize size) {
}

// -rオプションのコメントの出力(文字列の16進数ダンプ)
static void byteout_for_roption(address pc, codeptr store, ULONG bytes) {
static void byteout_for_roption(codeptr store, ULONG bytes) {
char buffer[MAX_DC_B_BUFSIZE + 16];
static char comment[] = ";\t\t";
comment[0] = Dis.commentStr[0];
Expand All @@ -791,7 +791,6 @@ static void byteout_for_roption(address pc, codeptr store, ULONG bytes) {

otherDirective2(comment, buffer);

pc += bytesPerLine;
bytes -= bytesPerLine;
} while (bytes);
}
Expand Down Expand Up @@ -906,8 +905,7 @@ static void strgen(address pc, address pcend) {
line = (address)(store0 - Dis.Ofst);
outputData2(line, OpString.dc[BYTESIZE], buffer);

if (Dis.r)
byteout_for_roption(line, store0, (ULONG)(store - (char*)store0));
if (Dis.r) byteout_for_roption(store0, (ULONG)(store - (char*)store0));
}
}
#undef ENTERSTR
Expand Down

0 comments on commit ee82792

Please sign in to comment.