Author Topic: Not a bug but ....  (Read 56 times)

jcfuller

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Not a bug but ....
« on: September 06, 2020, 02:42:00 PM »
Kevin,
  I normally use ASTYLE any time I use ULEX so this was overlooked until I forgot.
 Not really an issue but I thought I would mention it as it is not a big fix.


  ULEX cannot parse a line correctly in instr because of the lack of spaces around ">"

Line 25836:
    FPRINT FP_WRITE,"  if (!mane || !match || ! *match || (unsigned int) offset>strlen(mane)) return 0;"


offset>strlen(mane)


James

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Not a bug but ....
« Reply #1 on: September 06, 2020, 04:54:10 PM »
Kevin,
  I normally use ASTYLE any time I use ULEX so this was overlooked until I forgot.
 Not really an issue but I thought I would mention it as it is not a big fix.


  ULEX cannot parse a line correctly in instr because of the lack of spaces around ">"

Line 25836:
    FPRINT FP_WRITE,"  if (!mane || !match || ! *match || (unsigned int) offset>strlen(mane)) return 0;"

offset>strlen(mane)

James

JC ... but what about the others

And if your only problem is >strlen why not fix that in ULEX, knowing
that >strlen exists in many parts of the runtime and elsewhere in the code generation?


 IF Use_Instr THEN
    FPRINT FP_WRITE,"int instr(LPCTSTR mane,LPCTSTR match,int offset,int sensflag)"
    FPRINT FP_WRITE,"{"
    FPRINT FP_WRITE,"  LPCTSTR s;"
    FPRINT FP_WRITE,"  if (!mane || !match || ! *match || (unsigned int) offset>strlen(mane)) return 0;"
    FPRINT FP_WRITE,"  if (sensflag)"
    FPRINT FP_WRITE,"    s = _stristr_(offset>0 ? mane+offset-1 : mane,match);"
    FPRINT FP_WRITE,"  else"
    FPRINT FP_WRITE,"    s = strstr(offset>0 ? mane+offset-1 : mane,match);"
    FPRINT FP_WRITE,"  return s ? (int)(s-mane)+1 : 0;"
    FPRINT FP_WRITE,"}\n\n"
  END IF


« Last Edit: September 07, 2020, 11:51:27 AM by MrBcx »

jcfuller

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Not a bug but ....
« Reply #2 on: September 06, 2020, 05:21:41 PM »
Kevin,
  This was just an observation. You mentioned in one of your updates about creating better formatted output.
Also didn't Robert have post about "c" format?
I use ASTYLE so it is moot to me. Sorry to bother you.

James

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Not a bug but ....
« Reply #3 on: September 06, 2020, 05:53:09 PM »
Kevin,
  This was just an observation. You mentioned in one of your updates about creating better formatted output.
Also didn't Robert have post about "c" format?
I use ASTYLE so it is moot to me. Sorry to bother you.

James

JC -- It's not that your post was a "bother" ...  more that it was confusing. 

You singled out one specific line in one specific function -- what was I to think?