| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Coding style |
>> fread ( >> s[r[i]->target].typeid, >> sizeof (short int), 1, f >> ); > IMNSHO, both are somewhat unreadable. :-) Yes. That is a bit tricky. > fread( > s[r[i]->target].typeid, /* can't we clean this one up? */ > sizeof(short int), /* short int is the same as just short */ > 1, > f > ); > Well, that's better, but... This makes it easily pretty long. But it sure is a lot cleaner. At least with Windows it's better. I hate long function calls. > const size_t read_target = r[i]->target; > const short* p_typeid = s[read_target].typeid; > fread(p_typeid, sizeof(*p_typeid), 1, f); > That I find to be much improved. Just my opinion, of > course. That might be worth considering. But it looks a bit messy since there is so much code to simplify one function call. On the other hand I use lot's of similar fread()s on the project that the sample was taken from. ... All you need is love. --- BBBS/LiI v3.42 ToMmIk-3v* Origin: hidden (2:224/930.5) SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728 SEEN-BY: 670/213 218 @PATH: 224/0 22/10 220/851 20/11 24/888 396/1 633/260 635/506 728 633/267 |
|
| 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™.