Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonSmith committed Mar 1, 2024
1 parent f3fe011 commit 6e59ff6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 14 additions & 1 deletion rtl/eclrtl/rtltype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void rtlPadTruncString(unsigned & tgtLen, char * & tgt, unsigned newLen, unsigne
{
if (len > newLen)
len = newLen;
char * buff = (char *)malloc(len);
char * buff = (char *)malloc(newLen);
memcpy(buff, src, len);
if (len < newLen)
memset(buff+len, ' ', newLen - len);
Expand All @@ -87,10 +87,23 @@ __int64 rtlBcdToInteger(unsigned len, char * src)

void rtlIntegerToBcd(unsigned & tgtLen, char * & tgt, unsigned digits, __int64 value)
{
tgtLen = (digits + 1) / 2;
tgt = (char *)malloc(tgtLen);
char * cur = tgt + tgtLen - 1;
for (unsigned i = 0; i < digits; i += 2)
{
*cur-- = (value % 10) | ((value / 10 % 10) << 4);
value /= 100;
}
}

void rtlIntegerToBcdFixed(char * tgt, unsigned digits, __int64 value)
{
for (unsigned i = 0; i < digits; i += 2)
{
*tgt++ = (value % 10) | ((value / 10 % 10) << 4);
value /= 100;
}
}

//=============================================================================
Expand Down
2 changes: 0 additions & 2 deletions system/jlib/jdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,6 @@ void printProcMap(const char *fn, bool printbody, bool printsummary, StringBuffe
}
while (reader.nextln()) {
const char *ln = reader.ln;
unsigned n=0;
if (*ln) {
offset_t start = readHexNum(ln);
if (last&&(last!=start)) {
Expand Down Expand Up @@ -3360,7 +3359,6 @@ void printProcMap(const char *fn, bool printbody, bool printsummary, StringBuffe
recs[t].total += ssz;
if (ssz>recs[t].largest)
recs[t].largest = ssz;
n++;
last = end;
#ifndef __64BIT__
if ((end<0xffffffff)&&(end>=0xc0000000)) // rest is OS (32-bit only)
Expand Down

0 comments on commit 6e59ff6

Please sign in to comment.