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. General Programming
  3. C / C++ / MFC
  4. Passing macro parameters via function

Passing macro parameters via function

Scheduled Pinned Locked Moved C / C++ / MFC
help
8 Posts 3 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.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    registerSAM))

    Any help would be appreciated.

    ">

    Richard Andrew x64R L 2 Replies Last reply
    0
    • V Vaclav_

      registerSAM))

      Any help would be appreciated.

      ">

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Vaclav_Sal wrote:

      #define portREGISTER(port,registerSAM) (&;(port->registerSAM))

      Since you already have a & character in the macro definition, why do you have one in the macro call?

      Vaclav_Sal wrote:

      P_CB[iIndex] =   portREGISTER(digitalPinToPort(*TFT_LCD_ControlPins),&(cRegisterType));

      The difficult we do right away... ...the impossible takes slightly longer.

      V 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        Vaclav_Sal wrote:

        #define portREGISTER(port,registerSAM) (&;(port->registerSAM))

        Since you already have a & character in the macro definition, why do you have one in the macro call?

        Vaclav_Sal wrote:

        P_CB[iIndex] =   portREGISTER(digitalPinToPort(*TFT_LCD_ControlPins),&(cRegisterType));

        The difficult we do right away... ...the impossible takes slightly longer.

        V Offline
        V Offline
        Vaclav_
        wrote on last edited by
        #3

        This was just an attempt to solve the problem, passing "just" char did not work either. I thin I found a workaround / hack to fix this, but still like to know how to pass the symbol as a variable.

        1 Reply Last reply
        0
        • V Vaclav_

          registerSAM))

          Any help would be appreciated.

          ">

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I do not see any macro here, and I really cannot understand what all the above is supposed to do. It would really help, as I have suggested many times, if you showed the actual code clearly, and within <pre> tags so it is readable.

          V 1 Reply Last reply
          0
          • L Lost User

            I do not see any macro here, and I really cannot understand what all the above is supposed to do. It would really help, as I have suggested many times, if you showed the actual code clearly, and within <pre> tags so it is readable.

            V Offline
            V Offline
            Vaclav_
            wrote on last edited by
            #5

            #define portREGISTER(port,registerSAM) (&(port->registerSAM))

            L 1 Reply Last reply
            0
            • V Vaclav_

              #define portREGISTER(port,registerSAM) (&(port->registerSAM))

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I think your excessive use of the addressof operator (&) is confusing the compiler.

              V 1 Reply Last reply
              0
              • L Lost User

                I think your excessive use of the addressof operator (&) is confusing the compiler.

                V Offline
                V Offline
                Vaclav_
                wrote on last edited by
                #7

                And I think you really do not know the answer and just wasting your time. If you bother to follow the thread I did mention I tested it without the & and it did not work. I suppose since I did not use code tags correctly it is my fault. Thanks, go back to policing the posts. You do that very well. Have a nice day.

                L 1 Reply Last reply
                0
                • V Vaclav_

                  And I think you really do not know the answer and just wasting your time. If you bother to follow the thread I did mention I tested it without the & and it did not work. I suppose since I did not use code tags correctly it is my fault. Thanks, go back to policing the posts. You do that very well. Have a nice day.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  :((

                  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