Skip to content

Commit

Permalink
dc: explicitly declare signed char for number buffers
Browse files Browse the repository at this point in the history
Parts of the code depend on char being signed.

Showed up for me trying square root, but probably affects other stuff
too.
  • Loading branch information
Ciaran Anscomb committed Jan 23, 2025
1 parent 984f056 commit 61a73e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Applications/V7/cmd/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#define errorrt(p) {printf(p); return NULL; }

struct blk {
char *rd;
char *wt;
char *beg;
char *last;
signed char *rd;
signed char *wt;
signed char *beg;
signed char *last;
};
struct sym {
struct sym *next;
Expand Down Expand Up @@ -145,8 +145,8 @@ void (*outdit) (struct blk *, int);
int logo;
int intlog10;
int count;
char *pp;
char *dummy;
signed char *pp;
signed char *dummy;

int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -1996,7 +1996,7 @@ void sdump(char *s1, struct blk *hptr)

void seekc(struct blk *hptr, int n)
{
char *nn, *p;
signed char *nn, *p;

nn = hptr->beg + n;
if (nn > hptr->last) {
Expand Down Expand Up @@ -2123,7 +2123,7 @@ void garbage(char *s)
void redef(struct blk *p)
{
register int offset;
register char *newp;
register signed char *newp;

if ((int) p->beg & 01) {
printf("odd ptr %o hdr %o\n", p->beg, p);
Expand Down

0 comments on commit 61a73e4

Please sign in to comment.