14 Commits

Author SHA1 Message Date
Stanislav Gromov
0cb9fb3ff6 Misc. minor fixes (#423)
* Misc. minor fixes

* Fix OOB array access in encode_cell()

* Fix memory leaks in plungequalifiedfile()

* Remove redundant NULL pointer checks

* Fix invalid uses of realloc()

* Remove 'do_switch()'

* Don't use 'strlen()' to identify empty strings

* Other minor fixes

* Fix incorrect error message when compression is ineffective

* Add macro 'strempty' to identify empty strings
2019-06-17 02:57:49 +02:00
Zeex
16995c5ee1 Whitespace cleanup 2018-08-11 23:12:45 +06:00
Daniel_Cortez
8c1133b00d sc7: Optimize string copying in rebuffer() and stgwrite() 2018-01-19 23:16:04 +07:00
Daniel_Cortez
939c06011d emit/__emit: Another syntax change 2017-12-10 03:51:19 +07:00
Daniel_Cortez
d5691209d6 emit/__emit: Move the "anti-optimisation" workaround to 'emit_parse_line()'
Conflicts:
	source/compiler/sc1.c
2017-12-06 21:52:51 +07:00
Alex Martin
a4dbe02330 minor cleanup 2017-10-19 21:08:20 +02:00
Daniel_Cortez
8665f8b03c Code cleanup, style fixes 2017-10-19 21:08:20 +02:00
Alex Martin
cbf7e661d2 fix previous stage buffer performance opt 2017-10-19 21:08:20 +02:00
Alex Martin
66e745a94b improve write op performance 2017-10-19 21:08:20 +02:00
Zeex
3a4878f54b Fix clang warnings 2017-02-11 19:32:10 +06:00
Zeex
669aef06ef Remove remaining string expansion business from optimizer
This makes optimization work again.

Fixed #56
2015-04-11 22:48:52 +06:00
Zeex
867f6902f3 Remove string compression
This removes all scpack-packed strings and moves normal strings from
.scp files to corresponding .c files. The code responding for packing
and unpacking is gone as well.

If you have enough memory to run a SA-MP server you most likely have
more than enough of it to not worry about saving a few additional KBs
of text. Besides, these strings were kind of hard to navigate / edit,
and you could easily forget to regenerate them with scpack (though it
could be automated).
2015-04-06 16:38:08 +06:00
Zeex
200abb1d75 Fix grow_stgbuffer() not updating buffer size
The grow_stgbuffer() function, which grows the staging buffer, was
not updating the buffer size after reallocating the buffer itself.
This caused lots of reallocations because stgwrite() calls this
function for every character (!).

This also decreases compile times by ~20% (from 10s down to 8s in
my setup).
2014-01-25 20:06:58 +07:00
Zeex
766b96bcf3 Lower case directory names 2013-09-19 13:06:46 +07:00