pairochjulrat / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Eliminate simple uses of snprintf #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The VM makes calls to snprintf() in some places to format integers as strings.  
Some of these are very simple cases that can be replaced with a simpler 
function like ltoa()... which could be manually coded in the VM.

The goal is to reduce external dependencies.

snprintf() is used in float.c, int.c, strobj.c and heap.c.  There are only 2 
places where snprintf() is not easily replaced: formatting floats and 
python-string formatting (where string format args can be complex).

Original issue reported on code.google.com by dwhall...@gmail.com on 15 Dec 2011 at 5:24

GoogleCodeExporter commented 9 years ago
- Removed use in heap.c in favor of direct character manipulation.
- Removed uses in int.c and obj.c and used the new sli_ltoa10() function 
instead.
- Created sli_ltoa10() and sli_puts() in sli.c

Original comment by dwhall...@gmail.com on 15 Dec 2011 at 5:27

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8e58f9f66b31.

Original comment by dwhall...@gmail.com on 15 Dec 2011 at 5:31