Frank Richter wrote:
> On 27.11.2007 09:28, Michael Stefaniuc wrote:
>> Just go for
>> if ( !pSrcFile )
>>return D3DXERR_INVALIDDATA;
>>
>> LPWSTR pSrcFileW = NULL;
>> DWORD len;
>> HRESULT ret;
>> ...
>
> That's C++, not C, isn't it?
No it is C as C99 allows to have the variable definitions i
On 27.11.2007 09:28, Michael Stefaniuc wrote:
> Just go for
> if ( !pSrcFile )
>return D3DXERR_INVALIDDATA;
>
> LPWSTR pSrcFileW = NULL;
> DWORD len;
> HRESULT ret;
> ...
That's C++, not C, isn't it?
-f.r.
[EMAIL PROTECTED] wrote:
> I say that it is more readable because I understood you wanted the return
> code as soon as possible, but, anyway, what would you propose as code for
> this function?
>
> Would the following work for you?
Just go for
if ( !pSrcFile )
return D3DXERR_INVALIDDATA;
LPWST
I say that it is more readable because I understood you wanted the return
code as soon as possible, but, anyway, what would you propose as code for
this function?
Would the following work for you?
+
+ if ( !pSrcFile )
+ return D3DXERR_INVALIDDATA;
+ else
+ {
+ LPWSTR pSrcFileW = NULL;
+
""Luis C. Busquets Pérez"" <[EMAIL PROTECTED]> wrote:
> Changed the if clauses to make the implementation more readable.
...
> + if ( !pSrcFile )
> + return D3DXERR_INVALIDDATA;
> + else
> + {
> + len = MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, NULL, 0 );
> + pSrcFileW = HeapAlloc( Ge