Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Querry Regarding Define

Reply
Thread Tools

Querry Regarding Define

 
 
Priya Mishra
Guest
Posts: n/a
 
      12-14-2005
Hi All,

#define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
name={sizeof(L##s)/2-1,L##s}
#define _L(a) (TPtrC((const TText *)L ## a))

can any one explain me the above two, I am geting bit confused.

Thanks In Advance.
Priya

 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=
Guest
Posts: n/a
 
      12-14-2005
"Priya Mishra" <(E-Mail Removed)> writes:
> #define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
> name={sizeof(L##s)/2-1,L##s}
> #define _L(a) (TPtrC((const TText *)L ## a))


This looks like C++, not C.

DES
--
Dag-Erling Smørgrav - http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Pieter Droogendijk
Guest
Posts: n/a
 
      12-14-2005
On Wed, 14 Dec 2005 03:55:01 -0800, Priya Mishra wrote:

> Hi All,
>
> #define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
> name={sizeof(L##s)/2-1,L##s}


It's generally a good idea to keep your lines shorter than 80 characters.
Especially when posting to usenet. This would be a syntax error, but I'll
imagine there's a backslash at the end of the first line.

Also, _LIT16 is also a bad thing to call virtually anything, since you'd
be invading implementation namespace. The same goes for _L.

> #define _L(a) (TPtrC((const TText *)L ## a))


I couldn't tell you what they're for, but:

_LIT16 (poop, string)
Should expand to the following:
static const TLitC16<sizeof(Lstring)/2> \
poop={sizeof(Lstring)/2-1,Lstring}

Which looks like a C++ template function of some sort. See comp.lang.c++
for more information about this.

_L (voov);
Should expand to:
(TPtrC((const TText *)Lvoov));

Which looks like a screaming mad sort of wrapper thing. Or a macro to
build screaming mad sort of wrapper things. Or possibly an uran-utan.



Google tells me both macros are part of the Symbian Developer Library,
which is indeed a C++ API, and that both macros were in fact /NOT/
written by someone called Bergholt Stuttley Johnson.

http://www.symbian.com/developer/tec...it16Macro.html
http://www.symbian.com/developer/tec...LMacro.html#_L

> can any one explain me the above two, I am geting bit confused.


No wonder.

--
Pieter Droogendijk <pieter at binky dot org dot uk>
PGP/1E92DBBC [ Make way for the Emperor's Finest. ] binky.org.uk

 
Reply With Quote
 
Kleuskes & Moos
Guest
Posts: n/a
 
      12-14-2005
On Wed, 14 Dec 2005 03:55:01 -0800, Priya Mishra wrote:

> Hi All,
>
> #define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
> name={sizeof(L##s)/2-1,L##s}


This appears to be intended for a C++ program. It defines a
constant instance of the TLitC16 template passing the size of some
family of types or variables 'Lx' where x is an integer. Given the usage
of 'name', i suspect a backslash is ommitted.

> #define _L(a) (TPtrC((const TText *)L ## a))


This seems to define 'L' referenced above. A nice piece of obfuscated
coding.

> can any one explain me the above two, I am geting bit confused.


Obviously. This refers to a C++ program using templates. It isn't C.

> Thanks In Advance.


My pleasure.
 
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
querry regarding program to open a player mohan C Programming 7 01-05-2007 12:46 PM
querry regarding function pointer Lalatendu Das C Programming 7 03-16-2006 05:30 PM
Parse querry string with ssi SpaceGirl HTML 2 05-23-2004 02:33 AM
feedback form querry Graham HTML 1 02-12-2004 05:11 PM
querry Varsha MCSD 6 01-05-2004 05:34 PM



Advertisments