Restructure update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9634

    #46
    Originally posted by TJS
    Do you think it might be made VS compatible sometime?
    Well, you never know - maybe Microsoft will implement support for modern C one day

    By the way, have you checked out this thread? I assume that it is not much help, but there might be something in there of use to you.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • TJS
      Swordsman
      • May 2008
      • 473

      #47
      Originally posted by Nick
      Well, you never know - maybe Microsoft will implement support for modern C one day
      Seems completely mad that Microsoft won't implement the latest standards.

      I guess that it is a balance though between wanting to use the latest shiny code standards and reducing compatibility for people who might want to help with the game

      Are the new code standards that vital to use despite reducing who can compile the game? (Genuine question I'm not trying to be argumentative or anything, I'm not really up to date on these things). Angband used to compile on VS no problem in the past.

      By the way, have you checked out this thread? I assume that it is not much help, but there might be something in there of use to you.
      I spend a few hours trying to get it to compile on various systems. I got MinGW working, but I couldn't figure out any way of debugging it or a IDE that went with it. I couldn't figure out Eclipse at all. I suck at this sort of thing

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9634

        #48
        Originally posted by TJS
        I guess that it is a balance though between wanting to use the latest shiny code standards and reducing compatibility for people who might want to help with the game

        Are the new code standards that vital to use despite reducing who can compile the game? (Genuine question I'm not trying to be argumentative or anything, I'm not really up to date on these things). Angband used to compile on VS no problem in the past.
        I tend to favour utility over shininess.

        I think
        Code:
        static struct init_module arrays_module = {
        "arrays",
        init_arrays,
        cleanup_arrays
        };
        should work (and the same for any other similar construction). Let me know if it does, and what other problems you run into, and we'll see what we can do
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • debo
          Veteran
          • Oct 2011
          • 2402

          #49
          Something with a '99' in its name should probably have a good patina by now, anyways
          Glaurung, Father of the Dragons says, 'You cannot avoid the ballyhack.'

          Comment

          • Quendus
            Scout
            • Jun 2007
            • 32

            #50
            TJS did say they were using VS express 2010 - MS might have improved C99 support in VS 2012 and 2013 (which also have free express versions).

            Comment

            • KarlM
              Rookie
              • May 2007
              • 16

              #51
              Originally posted by TJS
              Ah ok thanks for the information, I guess that Angband is not going to normally be compilable on Visual C++.

              I might look into using another compiler and IDE, what do other people use when compiling the game?
              Run some version of Linux in a VM. My fave is debian in VirtualBox, but you have many options.
              "You hit Morgoth, Lord of Darkness. You have slain Morgoth, Lord of Darkness. Congratulations, you have won the game. The Great Wyrm of Balance breathes chaos. You die."

              Comment

              • TJS
                Swordsman
                • May 2008
                • 473

                #52
                Originally posted by Nick
                I tend to favour utility over shininess.

                I think
                Code:
                static struct init_module arrays_module = {
                "arrays",
                init_arrays,
                cleanup_arrays
                };
                should work (and the same for any other similar construction). Let me know if it does, and what other problems you run into, and we'll see what we can do
                Thanks that fixed that problem, but unfortunately there are loads of other errors as well:

                1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'ssize_t' : undeclared identifier
                1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2146: syntax error : missing ';' before identifier 'i'
                1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'i' : undeclared identifier
                1>c:\games\roguelikes\development\angband-latest\src\win\win-layout.c(21): fatal error C1083: Cannot open include file: 'ui-term.h': No such file or directory
                1>c:\games\roguelikes\development\angband-latest\src\win\scrnshot.c(20): fatal error C1083: Cannot open include file: 'png.h': No such file or directory
                1>c:\games\roguelikes\development\angband-latest\src\mon-lore.c(1545): error C2057: expected constant expression

                There's a fair few more after that (and probably more if those get fixed).

                I guess I'll have to look at other compilers.

                TJS did say they were using VS express 2010 - MS might have improved C99 support in VS 2012 and 2013 (which also have free express versions).
                I have the latest VS Express too, but it doesn't even allow you to create an empty win32 project (which is ridiculous).

                Comment

                • Nick
                  Vanilla maintainer
                  • Apr 2007
                  • 9634

                  #53
                  If you want to keep trying:

                  Originally posted by TJS
                  1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'ssize_t' : undeclared identifier
                  1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2146: syntax error : missing ';' before identifier 'i'
                  1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'i' : undeclared identifier
                  Replace ssize_t with int

                  Originally posted by TJS
                  1>c:\games\roguelikes\development\angband-latest\src\win\win-layout.c(21): fatal error C1083: Cannot open include file: 'ui-term.h': No such file or directory
                  Looks like an issue with not finding a higher level directory
                  Originally posted by TJS
                  1>c:\games\roguelikes\development\angband-latest\src\win\scrnshot.c(20): fatal error C1083: Cannot open include file: 'png.h': No such file or directory
                  This thread has some discussion of png issues (plus discussion of the ssize_t error, amd others)
                  Originally posted by TJS
                  1>c:\games\roguelikes\development\angband-latest\src\mon-lore.c(1545): error C2057: expected constant expression
                  As per thread, replace list_size with a #define value, or just 64

                  I'm disappointed more recent versions didn't help - you couldn't import a 2010 project, could you?
                  One for the Dark Lord on his dark throne
                  In the Land of Mordor where the Shadows lie.

                  Comment

                  • EpicMan
                    Swordsman
                    • Dec 2009
                    • 455

                    #54
                    I'm using VS 2013 at work and it has an empty project option under "Visual C++" that I use to compile 'Bands. As long as everything is a .c file it will compile as C and not C++. It's the premium version but I'd be surprised if the Express one lacked that option.

                    Getting sound to work is also a pain, but you can just comment out the #define SOUND statement (at least with older versions, haven't looked at the post-restructure code yet).

                    Comment

                    • Ingwe Ingweron
                      Veteran
                      • Jan 2009
                      • 2129

                      #55
                      Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
                      “We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.”
                      ― Tom Stoppard, Rosencrantz and Guildenstern are Dead

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9634

                        #56
                        Originally posted by Ingwe Ingweron
                        Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
                        Don't worry, when that happens I'll start a new thread

                        Sorry for getting your hopes up this time...
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • TJS
                          Swordsman
                          • May 2008
                          • 473

                          #57
                          Originally posted by Nick
                          If you want to keep trying:


                          Replace ssize_t with int


                          Looks like an issue with not finding a higher level directory

                          This thread has some discussion of png issues (plus discussion of the ssize_t error, amd others)

                          As per thread, replace list_size with a #define value, or just 64

                          I'm disappointed more recent versions didn't help - you couldn't import a 2010 project, could you?
                          Hey up, sorry for the delay in replying I've not had a chance to have a look at this until now.

                          Ok so it turns out there are two Visual Studio 2013 applications, one is called Visual Studio 2013 for Windows and the other is Visual Studio 2013 for Windows Desktop. I needed the latter and had installed the former.

                          The good news is that it does apparently conform to the C99 standards (or at least most of them). So the struct initialisation problem has gone away now.

                          [I still need to comment out get.c and get.h and you still can't use a static constant to define array length. I still had to replace ssize_t with int too. So maybe it doesn't use all the latest standards]

                          There are still a couple of compilation errors:

                          Error 4 error C2133: 'itypes' : unknown size angband-latest\src\load.c Line 780
                          Error 5 error C4703: potentially uninitialized local pointer variable 'chunk' used angband-latest\src\generate.c Line 752
                          Error 6 error C4703: potentially uninitialized local pointer variable 'info_ptr' used angband-latest\src\win\scrnshot.c Line 106

                          Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
                          Apologies for spamming this thread with this stuff.

                          Comment

                          • Nick
                            Vanilla maintainer
                            • Apr 2007
                            • 9634

                            #58
                            Originally posted by TJS
                            The good news is that it does apparently conform to the C99 standards (or at least most of them). So the struct initialisation problem has gone away now.
                            Great.

                            [I still need to comment out get.c and get.h and you still can't use a static constant to define array length. I still had to replace ssize_t with int too. So maybe it doesn't use all the latest standards]
                            ssize_t is not C standard (it's POSIX standard), so we should be using int. get.c and get.h are not included in the standard buildsystem build, and will probably go from the codebase altogether.


                            Code:
                            Error	4	error C2133: 'itypes' : unknown size  angband-latest\src\load.c	Line 780
                            This is another non-constant array declaration - my bad.

                            Code:
                            Error	5	error C4703: potentially uninitialized local pointer variable 'chunk' used	angband-latest\src\generate.c	Line 752
                            Error	6	error C4703: potentially uninitialized local pointer variable 'info_ptr' used	angband-latest\src\win\scrnshot.c	Line 106
                            These are both pointer variables that should be initialized to NULL when they're defined.

                            Thanks for picking up all these - I will get to fixing them at some point, but this should keep you going for now.
                            One for the Dark Lord on his dark throne
                            In the Land of Mordor where the Shadows lie.

                            Comment

                            • KarlM
                              Rookie
                              • May 2007
                              • 16

                              #59
                              So you guys don't use the compiler to check for this stuff? It can save you a lot of time.

                              eg
                              When I'm writing C - code I solely use an editor and gcc. I was wondering if anyone could suggest a good and simple tool that will find unused variables, function declarations and possibly make some
                              "You hit Morgoth, Lord of Darkness. You have slain Morgoth, Lord of Darkness. Congratulations, you have won the game. The Great Wyrm of Balance breathes chaos. You die."

                              Comment

                              • AnonymousHero
                                Veteran
                                • Jun 2007
                                • 1393

                                #60
                                Originally posted by KarlM
                                So you guys don't use the compiler to check for this stuff? It can save you a lot of time.

                                eg
                                http://stackoverflow.com/questions/3...-clean-up-code
                                First of all that advice is 7 years old, i.e. ancient and largely irrelevant these days. Don't bother with static checkers unless you're writing aerospace software and are ready to deal with ALL the warnings/checks on a continual basis. (And run multiple linters and such.)

                                What you want for practical applications is to just add

                                -fsanitize=undefined
                                -fsanitize=address

                                to the clang/gcc command line. It's runtime checking, but the fact that it only points out real errors that you actually hit in the game means that it's actually humanly possible to actually fix all the issues.

                                Comment

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