Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Macro still floating above my head

Reply
Thread Tools

Macro still floating above my head

 
 
janus
Guest
Posts: n/a
 
      02-25-2012
Hello All,

I would need some to explain the below code.
#define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15

I understand "..." as variable arguments. But what is "_x"?

Regards, \Janus
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      02-25-2012
On 2/25/2012 11:02 AM, janus wrote:
> Hello All,
>
> I would need some to explain the below code.
> #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15
>
> I understand "..." as variable arguments. But what is "_x"?


A name for a macro parameter. The macro is equivalent to

#define RF_ARG16(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, \
p10, p11, p12, p13, p14, p15, ...) p15

or to

#define RF_ARG16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,...) p

In any guise, it looks like a symptom of macro overreach if
not outright macro abuse.

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d
 
Reply With Quote
 
 
 
 
88888 Dihedral
Guest
Posts: n/a
 
      02-25-2012
在 2012年2月26日星期日UTC+8上午12时02分47 ,janus写道:
> Hello All,
>
> I would need some to explain the below code.
> #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15
>
> I understand "..." as variable arguments. But what is "_x"?
>
> Regards, \Janus




在 2012年2月26日星期日UTC+8上午12时02分47 ,janus写道:
> Hello All,
>
> I would need some to explain the below code.
> #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15
>
> I understand "..." as variable arguments. But what is "_x"?
>
> Regards, \Janus


If the variaied number of arguments in a function somewhat like printf called everywhere, then the stack has to be used a lot.

I never call printf with more then 4 variables to show messages.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
We are currently buying Foundy Networks - primarily NetIron MLX andXMR but are also looking for BigIron RX, ServerIron WMS7, and FastIronFESX's. If you have the above or have access to the above from a clientlooking ro recover value, please sen Network/Software Buyer Cisco 1 07-30-2010 01:25 AM
GeForce 7800 GTX Head-to-Head @ TrustedReviews Silverstrand Front Page News 0 09-12-2005 11:25 PM
Re: Can I get at contents of <head></head> programmatically? Karl ASP .Net 0 09-15-2004 06:09 PM
PHP and ASP.NET go HEAD to HEAD showme ASP .Net 13 07-10-2004 09:44 PM
Injecting code into the <head></head> section Brian W ASP .Net 10 07-02-2003 07:53 PM



Advertisments