Close

Update for new behavour of GCC 7.3.0

A project log for G Code Cleaner

Clean up your G-Code by filtering unnecessary points.

agpcooperagp.cooper 12/09/2018 at 03:520 Comments

Update for GCC 7.3.0

The latest gcc has changed. I have had to recompile Xbgi library (i.e. 2D graphics) and I found sscanf() works differently (i.e. 0X? is recognised as hexadecimal).

I have opted to migrate from BGI (Windows) and Xbgi (linux), to ezxdisp.

"ezx" is short and sweet and is available for Windows and Linux.

The latest version is available at http://morihit.net/ezxdisp/

Previously I used sscanf() as follows:

      for (j=0;Line[j];j++) Line[j]=toupper(Line[j]);
      tmp=strchr(Line,'G');
      if (tmp!=NULL) {
        sscanf((tmp+1),"%lf",&f1);
        if (f1<0) f1=0;
        block[i]->G=(long)f1;
      }

It should read any number as a double which can be converted to long later.

Now "G0X7.122" is read as G=7, X=0.0 but "G1X7122" still works fine.

Now I have now coded:

      for (j=0;Line[j];j++) Line[j]=toupper(Line[j]);
      tmp=strchr(Line,'G');
      if (tmp!=NULL) {
        sscanf((tmp+1),"%ld",&d1);
        if (d1<0) d1=0;
        block[i]->G=d1;
      }

AlanX

Discussions