Nicolas Pennequin wrote:

I've updated my WPS tokenizer patch again.

<...>

Also, I'd appreciate it a lot if people who know what makes code big and what helps make it smaller (and not only them !) could have a look at my code and tell me what could be improved.

A couple of comments/nits:

* Make rtc_tags const too.

* Use for loops where appropriate (like searching the rtc_tags or all_tags arrays).

* To avoid warnings about unused arguments, a common idiom is "(void) arg;".

* How is show_sb_on_wps set to false? By clearing the wps_data struct somewhere?

* Factor out the "get filename" code for images.

* Is there any sane way to avoid the gotos in wps_parse? E.g., by calling a function or something?

* Consider manual common subexpression elimination in some places, like in the conditionals in draw_progress_bar. In my experience, GCC doesn't always do it where you might expect it to, and it can increase readability (shorter expressions).

* Shouldn't "while(wps_string " be "while(*wps_string "?

  Magnus

Reply via email to