Studio:Casting and pointers: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
m (Text replace - 'Category:Pointers' to 'Category:Studio:Pointers')
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:<br>
A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:
<tt>#pragma scl_function(FDI_GETUNICODENAME_SUID, FDI_GetUnicodeName)<br>
<source lang="c">
#pragma scl_string (FDI_GetUnicodeName, ascii_filename, 100)<br>
#pragma scl_function(GetUnicodeName)
#pragma scl_ptr (FDI_GetUnicodeName, unicode_language,  OUT,  PRIVATE)<br>
#pragma scl_cast (GetUnicodeName, name, unsigned short*)
#pragma scl_string (FDI_GetUnicodeName, unicode_language, 100)<br>
#pragma scl_ptr (GetUnicodeName, name"OUT",  PRIVATE)
#pragma scl_cast (FDI_GetUnicodeName, unicode_name, unsigned short*)<br>
#pragma scl_string (GetUnicodeName, name, 100)
#pragma scl_ptr (FDI_GetUnicodeName, unicode_name,  OUT,  PRIVATE)<br>
</source>
#pragma scl_string (FDI_GetUnicodeName, unicode_name, 100)</tt>
[[Category:Studio:Pointers]]
 
 
[[Category:KB]]

Latest revision as of 00:41, 21 August 2009

A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:

#pragma scl_function(GetUnicodeName)
#pragma scl_cast (GetUnicodeName, name, unsigned short*)
#pragma scl_ptr (GetUnicodeName, name,  "OUT",  PRIVATE)
#pragma scl_string (GetUnicodeName, name, 100)