Compilation problem of game-cmd.c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Azerath
    Rookie
    • Jun 2011
    • 21

    Compilation problem of game-cmd.c

    Hi,

    In game-cmd.c (l:396; mrocess_command) the line:

    for (size_t i = 0; i < N_ELEMENTS(item_selector); i++)

    contains inline declaration and initialization of variable.
    In all other for loop places (about 1000 of them) initialization from declaration is separated, so it seems to be a mistake.

    This prevents me from compiling "just-from-repo" on windows, directly from Visual Studio project.

    It would make sense to make consistent variable usage - proably easier to change this one place instead of thousands others...

    Thanks!
  • d_m
    Angband Devteam member
    • Aug 2008
    • 1517

    #2
    Originally posted by Azerath
    Hi,

    In game-cmd.c (l:396; mrocess_command) the line:

    for (size_t i = 0; i < N_ELEMENTS(item_selector); i++)

    contains inline declaration and initialization of variable.
    In all other for loop places (about 1000 of them) initialization from declaration is separated, so it seems to be a mistake.

    This prevents me from compiling "just-from-repo" on windows, directly from Visual Studio project.

    It would make sense to make consistent variable usage - proably easier to change this one place instead of thousands others...

    Thanks!
    Good catch--it does indeed go against our coding style and will be fixed.

    Thanks!
    linux->xterm->screen->pmacs

    Comment

    • Azerath
      Rookie
      • Jun 2011
      • 21

      #3
      Mouse walking

      I'm trying to debug mouse moving as it seems to not work.

      the "cmd_set_arg_point in game-cmd.c (l:314)" has ..., int x, int y arguments, but is called in cmd2.c (l:2042) as:

      if (findpath(args[0].point.y, args[0].point.x))

      switching coordinates makes mouse work!

      Regards

      Comment

      • d_m
        Angband Devteam member
        • Aug 2008
        • 1517

        #4
        Originally posted by Azerath
        I'm trying to debug mouse moving as it seems to not work.

        the "cmd_set_arg_point in game-cmd.c (l:314)" has ..., int x, int y arguments, but is called in cmd2.c (l:2042) as:

        if (findpath(args[0].point.y, args[0].point.x))

        switching coordinates makes mouse work!

        Regards
        Looks like you found another bug!

        If you wouldn't mind stopping by and opening tickets at http://trac.rephial.org that would help us out a lot.
        linux->xterm->screen->pmacs

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #5
          Originally posted by d_m
          Looks like you found another bug!

          If you wouldn't mind stopping by and opening tickets at http://trac.rephial.org that would help us out a lot.
          No need - I've committed the x/y swap, so thanks for that. The size_t declaration had already been fixed - not sure which version the OP was working from.
          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9637

            #6
            Originally posted by Azerath
            the "cmd_set_arg_point in game-cmd.c (l:314)" has ..., int x, int y arguments, but is called in cmd2.c (l:2042) as:

            if (findpath(args[0].point.y, args[0].point.x))

            switching coordinates makes mouse work!
            Awesome, thanks! There's nothing worse than having to chase down bugs in stolen code...
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎