<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puzzles/misc.c, branch rockbox</title>
<subtitle>My sgt-puzzles tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/'/>
<entry>
<title>Introduce ftoa() as a replacement for the %g format specifier</title>
<updated>2020-12-08T00:27:19+00:00</updated>
<author>
<name>Franklin Wei</name>
<email>me@fwei.tk</email>
</author>
<published>2017-08-17T19:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=b1f691f2deb0b59c6e237241e1995c5d95f37ffa'/>
<id>b1f691f2deb0b59c6e237241e1995c5d95f37ffa</id>
<content type='text'>
Not all platforms support printing floats, this is a more
portable (if uglier) way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not all platforms support printing floats, this is a more
portable (if uglier) way.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename memswap() to swap_regions()</title>
<updated>2020-12-08T00:27:19+00:00</updated>
<author>
<name>Franklin Wei</name>
<email>me@fwei.tk</email>
</author>
<published>2017-05-17T20:43:19+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=562fb5ed8fb3b18ec30c8598ab48b08aac63bdf1'/>
<id>562fb5ed8fb3b18ec30c8598ab48b08aac63bdf1</id>
<content type='text'>
"swap_regions()" is first of all more descriptive, but more
importantly, it doesn't break builds on Rockbox!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"swap_regions()" is first of all more descriptive, but more
importantly, it doesn't break builds on Rockbox!
</pre>
</div>
</content>
</entry>
<entry>
<title>Adopt C99 bool in misc.c functions.</title>
<updated>2018-11-13T21:48:24+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2018-11-13T21:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=836a5c4ea742cc2ab23537993e8c54b251ae803b'/>
<id>836a5c4ea742cc2ab23537993e8c54b251ae803b</id>
<content type='text'>
The 'decode' flag to obfuscate_bitmap and the 'wrap' flag to
move_cursor are the only ones affected here.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'decode' flag to obfuscate_bitmap and the 'wrap' flag to
move_cursor are the only ones affected here.
</pre>
</div>
</content>
</entry>
<entry>
<title>misc.c: Fix implementation of free_keys.</title>
<updated>2018-06-14T22:39:49+00:00</updated>
<author>
<name>Lennard Sprong</name>
<email>x-sheep@users.noreply.github.com</email>
</author>
<published>2018-06-14T19:45:26+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=506b07352ae225c74e79f6c6e7872bc2005bdb53'/>
<id>506b07352ae225c74e79f6c6e7872bc2005bdb53</id>
<content type='text'>
The previous version attempted to free the first element multiple times.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous version attempted to free the first element multiple times.
</pre>
</div>
</content>
</entry>
<entry>
<title>Build fix: stop initialising an auto char array.</title>
<updated>2018-04-23T17:42:13+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2018-04-23T17:42:13+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=f04923abbcd676585548c5824262cecb47ba6d11'/>
<id>f04923abbcd676585548c5824262cecb47ba6d11</id>
<content type='text'>
Checking with the standards, I think this is legal C99, but not legal
C89 - and we are compiling in C89 mode. Why _every_ version of gcc
didn't object, given all the warning and pedantry options, I'm not
sure, but one did, so I should fix it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Checking with the standards, I think this is legal C99, but not legal
C89 - and we are compiling in C89 mode. Why _every_ version of gcc
didn't object, given all the warning and pedantry options, I'm not
sure, but one did, so I should fix it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a request_keys() function with a midend wrapper.</title>
<updated>2018-04-22T16:04:50+00:00</updated>
<author>
<name>Franklin Wei</name>
<email>me@fwei.tk</email>
</author>
<published>2018-04-17T20:18:16+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=60a929a250cf4f7f87ac082e5705f9a838a7f8c8'/>
<id>60a929a250cf4f7f87ac082e5705f9a838a7f8c8</id>
<content type='text'>
This function gives the front end a way to find out what keys the back
end requires; and as such it is mostly useful for ports without a
keyboard. It is based on changes originally found in Chris Boyle's
Android port, though some modifications were needed to make it more
flexible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function gives the front end a way to find out what keys the back
end requires; and as such it is mostly useful for ports without a
keyboard. It is based on changes originally found in Chris Boyle's
Android port, though some modifications were needed to make it more
flexible.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move fgetline out into misc.c.</title>
<updated>2018-04-22T15:35:50+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2018-04-22T12:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=b7034aeb51a99336fca2e15837c8337481964f6d'/>
<id>b7034aeb51a99336fca2e15837c8337481964f6d</id>
<content type='text'>
I'm about to want to use it outside the GTK front end.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I'm about to want to use it outside the GTK front end.
</pre>
</div>
</content>
</entry>
<entry>
<title>Assorted char * -&gt; const char * API changes.</title>
<updated>2017-10-01T15:35:00+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2017-10-01T13:04:47+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=3276376d1be74b66970b88c3e941dcedf8d22474'/>
<id>3276376d1be74b66970b88c3e941dcedf8d22474</id>
<content type='text'>
I went through all the char * parameters and return values I could see
in puzzles.h by eye and spotted ones that surely ought to have been
const all along.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I went through all the char * parameters and return values I could see
in puzzles.h by eye and spotted ones that surely ought to have been
const all along.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use a proper union in struct config_item.</title>
<updated>2017-10-01T15:34:41+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2017-10-01T12:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=de67801b0fd3dfa11777c1ef86cd617baf376b7b'/>
<id>de67801b0fd3dfa11777c1ef86cd617baf376b7b</id>
<content type='text'>
This allows me to use different types for the mutable, dynamically
allocated string value in a C_STRING control and the fixed constant
list of option names in a C_CHOICES.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows me to use different types for the mutable, dynamically
allocated string value in a C_STRING control and the fixed constant
list of option names in a C_CHOICES.
</pre>
</div>
</content>
</entry>
<entry>
<title>New name UI_UPDATE for interpret_move's return "".</title>
<updated>2017-10-01T14:18:14+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2017-10-01T11:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/puzzles/commit/?id=eeb2db283de9115f7256fa4cc49597d63e06b0ab'/>
<id>eeb2db283de9115f7256fa4cc49597d63e06b0ab</id>
<content type='text'>
Now midend.c directly tests the returned pointer for equality to this
value, instead of checking whether it's the empty string.

A minor effect of this is that games may now return a dynamically
allocated empty string from interpret_move() and treat it as just
another legal move description. But I don't expect anyone to be
perverse enough to actually do that! The main purpose is that it
avoids returning a string literal from a function whose return type is
a pointer to _non-const_ char, i.e. we are now one step closer to
being able to make this code base clean under -Wwrite-strings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now midend.c directly tests the returned pointer for equality to this
value, instead of checking whether it's the empty string.

A minor effect of this is that games may now return a dynamically
allocated empty string from interpret_move() and treat it as just
another legal move description. But I don't expect anyone to be
perverse enough to actually do that! The main purpose is that it
avoids returning a string literal from a function whose return type is
a pointer to _non-const_ char, i.e. we are now one step closer to
being able to make this code base clean under -Wwrite-strings.
</pre>
</div>
</content>
</entry>
</feed>
