simon-git: puzzles (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sat Nov 29 10:41:35 GMT 2014


TL;DR:
  f781937 Change the policy for parsing underspecified params strings.
  69ab4b2 Fix a GINT_TO_POINTER that was back to front.
  2fe0667 Use the compile flag -std=c89 in place of -ansi.
  f806528 Remove another erroneous GINT_TO_POINTER.

Repository:     git://git.tartarus.org/simon/puzzles.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2014-11-29 10:41:35

commit f781937d0dd435fc24e13c117d38e530b4351d06
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=f781937d0dd435fc24e13c117d38e530b4351d06;hp=078d3c0a6d6ace0f524dea0c3e03d5fa9ba361c0
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 29 10:23:12 2014 +0000

    Change the policy for parsing underspecified params strings.
    
    In conversation with a user last week, it emerged that the command
    'solo --generate 1 9jk#12345' was giving a different game from the one
    it gave when I ran it, and it turns out that this is because I've set
    SOLO_DEFAULT=7jxdi in my environment to make GUI Solo automatically
    start up in my (current) favourite mode. And the difficulty setting
    from that parameter string was being reused to fill in the unspecified
    difficulty slot in the '9jk', so that the same params string was being
    interpreted differently by our two machines.
    
    This is certainly wrong - the whole point of random seed strings like
    that is to be interpreted the same way everywhere. But it's a side
    effect of something I did do on purpose, for people switching back and
    forth between playing randomly generated games and playing a game id
    pasted (or typed) in from elsewhere. So this fix, with a giant comment
    explaining it, I _think_ should retain the behaviour I originally
    wanted while getting rid of the behaviour I didn't.

 midend.c |   40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

commit 69ab4b2205cd41188c9aa5f5878f876c739c4800
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=69ab4b2205cd41188c9aa5f5878f876c739c4800;hp=f781937d0dd435fc24e13c117d38e530b4351d06
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 29 10:24:05 2014 +0000

    Fix a GINT_TO_POINTER that was back to front.
    
    Spotted by clang, which I just tried building this codebase with out
    of curiosity.

 gtk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 2fe0667f519a825e6c028b4365312a144b343d62
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=2fe0667f519a825e6c028b4365312a144b343d62;hp=69ab4b2205cd41188c9aa5f5878f876c739c4800
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 29 10:29:29 2014 +0000

    Use the compile flag -std=c89 in place of -ansi.
    
    This is probably slightly nicer anyway, in that it specifies exactly
    _which_ ANSI standard I'm talking about; but the main reason for
    making the change is that it means I can now build the Unix puzzles
    with clang.
    
    It's not that clang doesn't _support_ -ansi; it accepts it just fine
    on any command line that's actually doing some compiling. But on a
    link-only command line, i.e. with only object files as input and no
    sources, clang emits the annoying warning "argument unused during
    compilation: '-ansi", and if you have -Werror as well then that
    warning becomes an error.
    
    You'd think there would be some makefile flags variable I could
    nonetheless put -ansi in, but apparently not - automake passes CFLAGS
    to both compiles and to link-only commands.
    
    And you'd also think that surely I should be able to work around this
    by having my configure.ac do a test link and stop trying to use that
    option if it didn't work - especially since configure.ac already tests
    a bunch of compile options to make sure they don't object to system
    header files, after the time I found that a GTK header was
    incompatible with my usual -Werror. But in fact, if I change that
    AC_COMPILE_IFELSE to an AC_LINK_IFELSE, autoconf generates a single
    compile-and-link command line, and hence does not expose the problem
    using -ansi on link-only command lines.
    
    Fortunately, -std=c89 does not generate this same warning from clang.
    I don't know why not - surely the two options are more or less
    equivalent - but it makes my build work again for the moment.

 configure.ac |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit f806528a309d62f836d39ad9cc703e7592c9f68b
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=f806528a309d62f836d39ad9cc703e7592c9f68b;hp=2fe0667f519a825e6c028b4365312a144b343d62
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 29 10:39:00 2014 +0000

    Remove another erroneous GINT_TO_POINTER.
    
    This one shouldn't have been there at all - it had a pointer argument
    already, not an int.

 gtk.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



More information about the tartarus-commits mailing list