| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Find a word |
G'Day Paul,
-=> Quoting Paul Edwards to Frank Adam <=-
FA> while (*p++ == *p1 && *p1++) /* ";" whoops! */
PE> I think you want a ";" here. ";" is equivalent
to "{}". You
PE> want a do-nothing loop, no? BFN. Paul.
FA> if (!*p1)
FA> {
FA> return (char *)p2;
FA> }
Hm, it works with or without it, but yes without the semi colon it will
presumably go through an extra 2-3 instructions per character.
I can't remember why i thought it had to be off, could have had a problem
with the other two bugs there.
Btw, i would've thought the compiler should optimize that sort of loop,
and place the if(!*p1) test outside of it, but having just disassembled
it, doesn't seem to.
L8r Frank (fadam{at}ozemail.com.au).
___ Blue Wave/DOS v2.21
--- Maximus 3.01
* Origin: The Software Parlour (3:635/544)SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 711/401 409 410 413 SEEN-BY: 711/430 808 809 932 934 712/515 713/888 714/906 800/1 @PATH: 635/544 50/99 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.