Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. A couple of entries from the Codex Vomitus

A couple of entries from the Codex Vomitus

Scheduled Pinned Locked Moved The Weird and The Wonderful
help
26 Posts 13 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Gary Wheeler

    /***** Stuff that Windows did wrong *****/
    #ifdef ERROR
    #undef ERROR
    #endif
    #define ERROR (-1)
    #define OK (0)

    /***** Generic Stuff not in Windows *****/
    #ifndef TRUE
    #define TRUE 1
    #endif
    #ifndef FALSE
    #define FALSE 0
    #endif
    #ifndef NULL
    #define NULL 0
    #endif

    This is in a body of 'C' code I'm stuck with maintaining. This crap was originally written by a Sun UNIX jock who was a zero-order asshat.

    Software Zen: delete this;

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #9

    I have seen

    #define TRUE (1==1)

    Which is kinda OK But in the same code there was

    #define TRUE (2+2==4)
    #define FALSE (2+2=5)

    Which just goes to show testing wasn't his strong suit.

    Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    C 1 Reply Last reply
    0
    • G Gary Wheeler

      /***** Stuff that Windows did wrong *****/
      #ifdef ERROR
      #undef ERROR
      #endif
      #define ERROR (-1)
      #define OK (0)

      /***** Generic Stuff not in Windows *****/
      #ifndef TRUE
      #define TRUE 1
      #endif
      #ifndef FALSE
      #define FALSE 0
      #endif
      #ifndef NULL
      #define NULL 0
      #endif

      This is in a body of 'C' code I'm stuck with maintaining. This crap was originally written by a Sun UNIX jock who was a zero-order asshat.

      Software Zen: delete this;

      D Offline
      D Offline
      Dar Brett 0
      wrote on last edited by
      #10

      Asumming this is actually compiled using the Visual C++ compiler I think I get boolean and NULL stuff, but what's the ERROR definition for in Windows - does this break the #error directive or something crazy like that?

      G 1 Reply Last reply
      0
      • D Dar Brett 0

        Asumming this is actually compiled using the Visual C++ compiler I think I get boolean and NULL stuff, but what's the ERROR definition for in Windows - does this break the #error directive or something crazy like that?

        G Offline
        G Offline
        Gary Wheeler
        wrote on last edited by
        #11

        This is compiled using the C++ compiler from the Windows SDK. The O(0) moron refused to use Visual Studio. The whole fetid mess is glued together using a make file and a page of command line operations.

        Dar Brett wrote:

        I think I get boolean and NULL stuff

        TRUE and FALSE have been in windows.h for eons, as well as their 'type' BOOL, which O(0) didn't use. He used int's. The code also assumes in a lot of places that FALSE == 0 and TRUE == 1 by using the actual constants rather than the #define's.

        Dar Brett wrote:

        ERROR definition for in Windows - does this break the #error directive

        Windows defines ERROR as 0. It doesn't break #error, which is a compiler directive. It does break understanding return values from certain Windows API functions, mainly GDI. Fortunately this app is more or less a service, and there was no UI involved.

        Software Zen: delete this;

        D B 2 Replies Last reply
        0
        • G Gary Wheeler

          This is compiled using the C++ compiler from the Windows SDK. The O(0) moron refused to use Visual Studio. The whole fetid mess is glued together using a make file and a page of command line operations.

          Dar Brett wrote:

          I think I get boolean and NULL stuff

          TRUE and FALSE have been in windows.h for eons, as well as their 'type' BOOL, which O(0) didn't use. He used int's. The code also assumes in a lot of places that FALSE == 0 and TRUE == 1 by using the actual constants rather than the #define's.

          Dar Brett wrote:

          ERROR definition for in Windows - does this break the #error directive

          Windows defines ERROR as 0. It doesn't break #error, which is a compiler directive. It does break understanding return values from certain Windows API functions, mainly GDI. Fortunately this app is more or less a service, and there was no UI involved.

          Software Zen: delete this;

          D Offline
          D Offline
          Dar Brett 0
          wrote on last edited by
          #12

          Gotcha, I wasn't far off with the BOOL stuff. Not that I'd change it, but isn't it weird that ERROR == ERROR_SUCCESS?

          G 1 Reply Last reply
          0
          • D Dar Brett 0

            Gotcha, I wasn't far off with the BOOL stuff. Not that I'd change it, but isn't it weird that ERROR == ERROR_SUCCESS?

            G Offline
            G Offline
            Gary Wheeler
            wrote on last edited by
            #13

            The ERROR value was used as a return from some GDI functions. ERROR_SUCCESS is a far more general Windows API return value.

            Software Zen: delete this;

            1 Reply Last reply
            0
            • G Gary Wheeler

              /***** Stuff that Windows did wrong *****/
              #ifdef ERROR
              #undef ERROR
              #endif
              #define ERROR (-1)
              #define OK (0)

              /***** Generic Stuff not in Windows *****/
              #ifndef TRUE
              #define TRUE 1
              #endif
              #ifndef FALSE
              #define FALSE 0
              #endif
              #ifndef NULL
              #define NULL 0
              #endif

              This is in a body of 'C' code I'm stuck with maintaining. This crap was originally written by a Sun UNIX jock who was a zero-order asshat.

              Software Zen: delete this;

              M Offline
              M Offline
              Matt McGuire
              wrote on last edited by
              #14

              Gary Wheeler wrote:

              zero-order asshat

              That is probably the best quote I've seen in awhile :-D

              G 1 Reply Last reply
              0
              • M Matt McGuire

                Gary Wheeler wrote:

                zero-order asshat

                That is probably the best quote I've seen in awhile :-D

                G Offline
                G Offline
                Gary Wheeler
                wrote on last edited by
                #15

                :bows: Thank you, thank you! I'm here all week. Try the veal, it's to die for!

                Software Zen: delete this;

                Richard DeemingR 1 Reply Last reply
                0
                • G Gary Wheeler

                  :bows: Thank you, thank you! I'm here all week. Try the veal, it's to die for!

                  Software Zen: delete this;

                  Richard DeemingR Offline
                  Richard DeemingR Offline
                  Richard Deeming
                  wrote on last edited by
                  #16

                  Gary Wheeler wrote:

                  Try the veal, it's to die for!

                  Is it ... veally good? :-D


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                  J 1 Reply Last reply
                  0
                  • Richard DeemingR Richard Deeming

                    Gary Wheeler wrote:

                    Try the veal, it's to die for!

                    Is it ... veally good? :-D


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    J Offline
                    J Offline
                    josda1000
                    wrote on last edited by
                    #17

                    I think it meats and exceeds people's expectations.

                    Josh Davis
                    This is what plays in my head when I finish projects.

                    1 Reply Last reply
                    0
                    • R Rick York

                      Good heavens. That's not only atrocious, it's just plain wrong.

                      C Offline
                      C Offline
                      CPallini
                      wrote on last edited by
                      #18

                      What's wrong?

                      1 Reply Last reply
                      0
                      • OriginalGriffO OriginalGriff

                        I have seen

                        #define TRUE (1==1)

                        Which is kinda OK But in the same code there was

                        #define TRUE (2+2==4)
                        #define FALSE (2+2=5)

                        Which just goes to show testing wasn't his strong suit.

                        Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                        C Offline
                        C Offline
                        CPallini
                        wrote on last edited by
                        #19

                        Hard to believe. But, yes, I believe it. :-D

                        1 Reply Last reply
                        0
                        • G Gary Wheeler

                          This is compiled using the C++ compiler from the Windows SDK. The O(0) moron refused to use Visual Studio. The whole fetid mess is glued together using a make file and a page of command line operations.

                          Dar Brett wrote:

                          I think I get boolean and NULL stuff

                          TRUE and FALSE have been in windows.h for eons, as well as their 'type' BOOL, which O(0) didn't use. He used int's. The code also assumes in a lot of places that FALSE == 0 and TRUE == 1 by using the actual constants rather than the #define's.

                          Dar Brett wrote:

                          ERROR definition for in Windows - does this break the #error directive

                          Windows defines ERROR as 0. It doesn't break #error, which is a compiler directive. It does break understanding return values from certain Windows API functions, mainly GDI. Fortunately this app is more or less a service, and there was no UI involved.

                          Software Zen: delete this;

                          B Offline
                          B Offline
                          BillW33
                          wrote on last edited by
                          #20

                          Quote:

                          The O(0) moron refused to use Visual Studio.

                          Sounds similar to a guy at a company that I used to work for. He did use Visual Studio, but he was "too good" to use the debugger, preferring to output values to a file to do testing. He also liked to keep his variable names <= 3 letters long to "save time". X|

                          Just because the code works, it doesn't mean that it is good code.

                          G D 2 Replies Last reply
                          0
                          • B BillW33

                            Quote:

                            The O(0) moron refused to use Visual Studio.

                            Sounds similar to a guy at a company that I used to work for. He did use Visual Studio, but he was "too good" to use the debugger, preferring to output values to a file to do testing. He also liked to keep his variable names <= 3 letters long to "save time". X|

                            Just because the code works, it doesn't mean that it is good code.

                            G Offline
                            G Offline
                            Gary Wheeler
                            wrote on last edited by
                            #21

                            BillW33 wrote:

                            he was "too good" to use the debugger, preferring to output values to a file to do testing

                            This software includes a 'built-in' debugger, which is basically a home-grown command-line assembler/disassembler. This is for debugging code written mostly in C. The makefile that builds this crap sets compile options to generate assembly language source files to aid in the debugging.

                            Software Zen: delete this;

                            1 Reply Last reply
                            0
                            • G Gary Wheeler

                              /***** Stuff that Windows did wrong *****/
                              #ifdef ERROR
                              #undef ERROR
                              #endif
                              #define ERROR (-1)
                              #define OK (0)

                              /***** Generic Stuff not in Windows *****/
                              #ifndef TRUE
                              #define TRUE 1
                              #endif
                              #ifndef FALSE
                              #define FALSE 0
                              #endif
                              #ifndef NULL
                              #define NULL 0
                              #endif

                              This is in a body of 'C' code I'm stuck with maintaining. This crap was originally written by a Sun UNIX jock who was a zero-order asshat.

                              Software Zen: delete this;

                              D Offline
                              D Offline
                              den2k88
                              wrote on last edited by
                              #22

                              It looks similar to the code I have to maintain. My gods...

                              GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X

                              G 1 Reply Last reply
                              0
                              • B BillW33

                                Quote:

                                The O(0) moron refused to use Visual Studio.

                                Sounds similar to a guy at a company that I used to work for. He did use Visual Studio, but he was "too good" to use the debugger, preferring to output values to a file to do testing. He also liked to keep his variable names <= 3 letters long to "save time". X|

                                Just because the code works, it doesn't mean that it is good code.

                                D Offline
                                D Offline
                                den2k88
                                wrote on last edited by
                                #23

                                Aww cr@p, I met these kind of "people"... and I'm currently maintaining their "work".

                                GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X

                                1 Reply Last reply
                                0
                                • D den2k88

                                  It looks similar to the code I have to maintain. My gods...

                                  GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X

                                  G Offline
                                  G Offline
                                  Gary Wheeler
                                  wrote on last edited by
                                  #24

                                  You have my most profound sympathies. Maybe we should start our own support group. Oh wait. That's what this forum is... :sigh:

                                  Software Zen: delete this;

                                  1 Reply Last reply
                                  0
                                  • G Gary Wheeler

                                    Yep, I've got over 100 source files chock-full of this kind of stuff. The average identifier length is about 5 characters, and eeeeeverything's global, sports fans! I'd like to kill the mother:elephant:er who wrote it.

                                    Software Zen: delete this;

                                    M Offline
                                    M Offline
                                    Mark_Wallace
                                    wrote on last edited by
                                    #25

                                    Maybe you should port it to Excel, since that's obviously what they want.

                                    I wanna be a eunuchs developer! Pass me a bread knife!

                                    G 1 Reply Last reply
                                    0
                                    • M Mark_Wallace

                                      Maybe you should port it to Excel, since that's obviously what they want.

                                      I wanna be a eunuchs developer! Pass me a bread knife!

                                      G Offline
                                      G Offline
                                      Gary Wheeler
                                      wrote on last edited by
                                      #26

                                      Mark_Wallace wrote:

                                      Maybe you should port it to Excel

                                      :laugh: ;P :laugh: ;P :laugh: That's outrageously funny. This software runs a piece of hardware that accepts a proprietary printer command language, renders that into bitmaps, and ships the bitmaps out a set of fiber optic connections to ink-jet print heads. This is on a press where we're printing up to 17 feet of paper per second, full color on both sides. I think this would win the "Best Abuse of Excel Macros" contest hands down.

                                      Software Zen: delete this;

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • World
                                      • Users
                                      • Groups