Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 29, 2011, 16:01   #1
Azerath
Rookie
 
Join Date: Jun 2011
Posts: 21
Azerath is on a distinguished road
Compilation problem of game-cmd.c

Hi,

In game-cmd.c (l:396; m:process_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!
Azerath is offline   Reply With Quote
Old June 29, 2011, 16:37   #2
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by Azerath View Post
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
d_m is offline   Reply With Quote
Old June 29, 2011, 16:58   #3
Azerath
Rookie
 
Join Date: Jun 2011
Posts: 21
Azerath is on a distinguished road
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
Azerath is offline   Reply With Quote
Old June 29, 2011, 17:27   #4
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by Azerath View Post
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
d_m is offline   Reply With Quote
Old June 29, 2011, 20:59   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by d_m View Post
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.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old June 29, 2011, 23:47   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,841
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by Azerath View Post
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.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problem (Windows 7) PowerWyrm Development 1 November 16, 2010 18:39
Compilation issues. Tiburon Silverflame Development 8 March 1, 2010 21:34
Problem Starting New Game karmatic Vanilla 9 January 27, 2010 05:58
Macro problem Zero Vanilla 2 June 20, 2008 15:52
Compilation issues: can't find -lSM Daven_26d1 Vanilla 10 July 22, 2007 08:52


All times are GMT +1. The time now is 11:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.