On May 2, 2013, at 10:39 PM, Bob Delaney wrote:

> In my plugin I have for inputString as a REALstring:
> 
> REALstringData                *rsData;
> 
> REALGetStringData(inputString, REALGetStringEncoding(inputString), rsData);
> 
> For that last statement I get the warning: 'rsData' is used uninitialized in 
> this function
> 
> How do I initialize 'rsData'?


I would suggest to declare

REALstring rsData;

and then call REALGetStringData using the ampersand:

REALGetStringData(inputString, REALGetStringEncoding(inputString), &rsData);

> 
> And I would appreciate it if someone would give me a good reference on these 
> matters.

sticking to your issue: I would recommend to declare a struct as a variable, 
not a pointer to a struct.  Uninitialized means that you don't provide 
allocated memory. Your way requires to malloc the pointer and later you need to 
dispose of this pointer.  

 

- Alfred Van Hoek
[email protected]
http://vanhoekplugins.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to