Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 9, 2010, 06:01   #21
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by nppangband View Post
What compilers take the Angband source cleanly?
I have built it on MingW32 by removing the --std=c99 option. I'm pretty sure both GNU make and BSD make work when coordinating build with GCC.

MSVC and OpenWatcom are both fails currently, due to change-for-the-sake-of-change directory structure reorganizations throwing off nmake and wmake respectively. I believe that both will work if the directory structure is re-flattened for platform-agnostic files.
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011
zaimoni is offline   Reply With Quote
Old June 9, 2010, 21:27   #22
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 nppangband View Post
I have made good progress in making all the changes from 3.06 to 3.2.2, but now I have some code from Angband 3.1.2 that simply won't compile for me (using LCC-win-32).

It is in util.c, in the function next_section (which is called only once, by text_out_e). ABout 10 lines into the function there is this stretch of code:

const char *close = strstr(s, "{/}");


I get multiple errors, which are making no sense...first off this line:

const char *close = strstr(s, "{/}");

It says I don't have a prototype for strstr, but string.h is included, and it gives no warning for the many other times in the source this function is called.

it also gives an error for having an operand with 'pointer to char' and 'int'

Does anyone have any suggestions?

My compiler also hates this line in inkey_aux, giving the message "incorrec char constant".

/* End "macro action" */
if ((ch == 30) || (ch == '\xff'))

What compilers take the Angband source cleanly? I am getting an awful lot of errors and compiler warnings from lcc-win. It doesn't seem to like the revised Angband source at all.

Thanks for any help or sugestions anyone may have.
Hmm. I suspect the next_section code is quite new, as an attempt to deal with overly long text output. If you're adept with svn you can find the commit which introduced (or last modified) it and contact the committer. (It wasn't me, so if it's less than 18 months old it must be takk, d_m or MD.)

I think most of the still-active developers use gcc (~minGW on Windows), which would explain why support for other compilers is so bad. Sorry.
Magnate is offline   Reply With Quote
Old June 10, 2010, 02:57   #23
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Found the problem......it was with LCC-win. Once I reinstalled it, all the strange compile errors went away. Thanks again.

And I apologize to the Angband source for all the bad things I said about it in the last 24 hours.
nppangband is offline   Reply With Quote
Old June 10, 2010, 14:37   #24
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Oh, one last thing. LCC-win comes very close to compiling the latest Angband source release (v3.1.2 2?), but it fails because there are two files names util.c (one in the src directory, one in src/player), and it won't make .obj files for both of they. Perhaps the duplicate file names in the various subdirectories of src (such as types.h, util.c) should all have unique names?
nppangband is offline   Reply With Quote
Old June 14, 2010, 15:59   #25
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Things are coming along well now. I have most of the code compatible from main-win.c, the util.c file, all the helper files, and the z-*** files. Now the code is dropping in nicely & the compile errors are less and less frequent....

One thing that it doesn't recognize is some of the mouse commands. An example is line 1005 from util.c

if ((ch == 30) || (ch == '\xff'))

I know the "\xff" part has to do with reading an entry from the mouse, but where is that defined so the game understands it. I have button.c in there, and I have checked all the help files, but I don't see where the game should understand what that means.

As always, thanks for any help anyone can offer.
nppangband is offline   Reply With Quote
Old June 14, 2010, 16:10   #26
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,862
Donated: $60
Nick will become famous soon enough
It's defined as the key for a mousepress in Term_mousepress in z-term.c, and Term_mousepress is called from all the main-xxx.c files as how the game responds to a mouse click from the operating system. What the game does with it is then defined by do_cmd_mouseclick in cmd0.c.

If I'm wrong, someone will correct me.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 14, 2010, 16:45   #27
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Nick - thanks. I will check into that when I get home.

Does the game know what '\xff' means, or does that have to be defined somewhere? Or is it like a keypress, where the game knows that 'y' and 'n' equate to the player pressing the y and n keys?
nppangband is offline   Reply With Quote
Old June 14, 2010, 17:21   #28
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 nppangband View Post
Does the game know what '\xff' means, or does that have to be defined somewhere? Or is it like a keypress, where the game knows that 'y' and 'n' equate to the player pressing the y and n keys?
'\xff' is (or should be) a character constant, kind of like '\n' or '\011'. In this case it's the number 255, aka 0377 in octal notation, aka 0xFF in hex notation.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old June 15, 2010, 14:41   #29
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by d_m View Post
'\xff' is (or should be) a character constant, kind of like '\n' or '\011'. In this case it's the number 255, aka 0377 in octal notation, aka 0xFF in hex notation.
I checked everything out, and all the necessary code is there. It gives me a warning when I try to save any file that has '\xff' in it. The warning is "incorrect character constant"

I guess I can just change it to 255.

My best guess is that I have inconsistent #define related to an operating system (for example, I get a compiler warning that bool is defined twice in h-basic.h, even though it is the exact same as the file as in the current Vanilla source). My other guess is that a variable in the current Angband source is defined differently than in the old source (many variables that were defined as cptr in Angband 3.0.6 are classified as char).

I will look for it once I get all the new code in and I can get the source to compile without errors.

Thanks again for the suggestions.
nppangband is offline   Reply With Quote
Old June 16, 2010, 20:34   #30
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
What compiler are you using that complains about '\xff'? That is bog standard (char)-1
encoding.
Anyway, you are right, making it a #define constant is the right thing to do in any case.
Pete Mack is online now   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
Trying to understand Ranger playing mechanics dormouse Vanilla 5 December 15, 2009 12:43
Angband Code Interface to GUI meeshoo Vanilla 50 February 3, 2009 18:18
I finally understand how diving quicker can be "safer" Wraitheist Vanilla 13 September 19, 2008 18:25
strange C code in Angband (am I reading this right?) will_asher Idle chatter 3 February 4, 2008 10:07
Angband source branches vs trac ctate Vanilla 1 July 14, 2007 12:43


All times are GMT +1. The time now is 18:31.


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