diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-17 12:51:05 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-17 12:51:05 -0300 |
| commit | ee5edb6b680589805c8fc348f6a7566c2bd8735d (patch) | |
| tree | ca0d801e40a0dcf98c4594bdaf97933193bfea71 /lobject.h | |
| parent | bda83e22c0ab3e6fffbf0a71e5e4a5869da8f6ab (diff) | |
| download | lua-ee5edb6b680589805c8fc348f6a7566c2bd8735d.tar.gz lua-ee5edb6b680589805c8fc348f6a7566c2bd8735d.tar.bz2 lua-ee5edb6b680589805c8fc348f6a7566c2bd8735d.zip | |
macros 'getaddrstr' and 'getstr' unified (they do the same thing)
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.112 2015/09/08 15:49:25 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.113 2015/09/08 16:54:52 roberto Exp roberto $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -325,9 +325,9 @@ typedef union UTString { | |||
| 325 | ** Get the actual string (array of bytes) from a 'TString'. | 325 | ** Get the actual string (array of bytes) from a 'TString'. |
| 326 | ** (Access to 'extra' ensures that value is really a 'TString'.) | 326 | ** (Access to 'extra' ensures that value is really a 'TString'.) |
| 327 | */ | 327 | */ |
| 328 | #define getaddrstr(ts) (cast(char *, (ts)) + sizeof(UTString)) | ||
| 329 | #define getstr(ts) \ | 328 | #define getstr(ts) \ |
| 330 | check_exp(sizeof((ts)->extra), cast(const char*, getaddrstr(ts))) | 329 | check_exp(sizeof((ts)->extra), cast(char *, (ts)) + sizeof(UTString)) |
| 330 | |||
| 331 | 331 | ||
| 332 | /* get the actual string (array of bytes) from a Lua value */ | 332 | /* get the actual string (array of bytes) from a Lua value */ |
| 333 | #define svalue(o) getstr(tsvalue(o)) | 333 | #define svalue(o) getstr(tsvalue(o)) |
