Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 7 +--- dlls/d3dx10_43/texture.c | 69 +++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 9 deletions(-)
On Mon, Nov 9, 2020 at 5:14 AM Ziqing Hui zhui@codeweavers.com wrote:
Signed-off-by: Ziqing Hui zhui@codeweavers.com
dlls/d3dx10_43/tests/d3dx10.c | 7 +--- dlls/d3dx10_43/texture.c | 69 +++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 9 deletions(-)
+ *size = SizeofResource(module, res_info); + if (*size == 0) + return HRESULT_FROM_WIN32(GetLastError()); + + resource = LoadResource(module, res_info); + if (!resource) + return HRESULT_FROM_WIN32(GetLastError()); + + *buffer = LockResource(resource); + if (*buffer == NULL) + return HRESULT_FROM_WIN32(GetLastError());
I'd prefer if these all looked like "if (!expression)" instead of using 3 slightly different styles for the 3 if conditions. You can also inline the assignments inside the respective ifs, in parentheses to avoid the gcc warning.