mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[c23,rdtk] replace NULL with nullptr
This commit is contained in:
@@ -93,7 +93,7 @@ rdtkButton* rdtk_button_new(rdtkEngine* engine, rdtkNinePatch* ninePatch)
|
|||||||
rdtkButton* button = (rdtkButton*)calloc(1, sizeof(rdtkButton));
|
rdtkButton* button = (rdtkButton*)calloc(1, sizeof(rdtkButton));
|
||||||
|
|
||||||
if (!button)
|
if (!button)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
button->engine = engine;
|
button->engine = engine;
|
||||||
button->ninePatch = ninePatch;
|
button->ninePatch = ninePatch;
|
||||||
@@ -127,7 +127,7 @@ int rdtk_button_engine_uninit(rdtkEngine* engine)
|
|||||||
if (engine->button)
|
if (engine->button)
|
||||||
{
|
{
|
||||||
rdtk_button_free(engine->button);
|
rdtk_button_free(engine->button);
|
||||||
engine->button = NULL;
|
engine->button = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ rdtkEngine* rdtk_engine_new(void)
|
|||||||
rdtkEngine* engine = (rdtkEngine*)calloc(1, sizeof(rdtkEngine));
|
rdtkEngine* engine = (rdtkEngine*)calloc(1, sizeof(rdtkEngine));
|
||||||
|
|
||||||
if (!engine)
|
if (!engine)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (rdtk_font_engine_init(engine) < 0)
|
if (rdtk_font_engine_init(engine) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -47,7 +47,7 @@ rdtkEngine* rdtk_engine_new(void)
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
rdtk_engine_free(engine);
|
rdtk_engine_free(engine);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdtk_engine_free(rdtkEngine* engine)
|
void rdtk_engine_free(rdtkEngine* engine)
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ static char* rdtk_font_load_descriptor_file(const char* filename, size_t* pSize)
|
|||||||
FILE* fp = winpr_fopen(filename, "r");
|
FILE* fp = winpr_fopen(filename, "r");
|
||||||
|
|
||||||
if (!fp)
|
if (!fp)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (_fseeki64(fp, 0, SEEK_END) != 0)
|
if (_fseeki64(fp, 0, SEEK_END) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -194,7 +194,7 @@ static char* rdtk_font_load_descriptor_file(const char* filename, size_t* pSize)
|
|||||||
if (readSize < 1)
|
if (readSize < 1)
|
||||||
{
|
{
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ static char* rdtk_font_load_descriptor_file(const char* filename, size_t* pSize)
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
WINPR_ATTR_NODISCARD
|
WINPR_ATTR_NODISCARD
|
||||||
@@ -294,7 +294,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
*q = '\0';
|
*q = '\0';
|
||||||
errno = 0;
|
errno = 0;
|
||||||
{
|
{
|
||||||
long val = strtol(p, NULL, 0);
|
long val = strtol(p, nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val == 0) || (val > UINT32_MAX))
|
if ((errno != 0) || (val == 0) || (val > UINT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -346,7 +346,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
*q = '\0';
|
*q = '\0';
|
||||||
errno = 0;
|
errno = 0;
|
||||||
{
|
{
|
||||||
const unsigned long val = strtoul(p, NULL, 0);
|
const unsigned long val = strtoul(p, nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val > UINT16_MAX))
|
if ((errno != 0) || (val > UINT16_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -413,7 +413,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
font->glyphCount = (uint16_t)count;
|
font->glyphCount = (uint16_t)count;
|
||||||
font->glyphs = NULL;
|
font->glyphs = nullptr;
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
font->glyphs = (rdtkGlyph*)calloc(font->glyphCount, sizeof(rdtkGlyph));
|
font->glyphs = (rdtkGlyph*)calloc(font->glyphCount, sizeof(rdtkGlyph));
|
||||||
@@ -461,7 +461,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
*q = '\0';
|
*q = '\0';
|
||||||
errno = 0;
|
errno = 0;
|
||||||
{
|
{
|
||||||
long val = strtol(p, NULL, 0);
|
long val = strtol(p, nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -502,7 +502,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
tok[1] = p + 1;
|
tok[1] = p + 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
{
|
{
|
||||||
long val = strtol(tok[0], NULL, 0);
|
long val = strtol(tok[0], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -510,7 +510,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
glyph->offsetX = (INT32)val;
|
glyph->offsetX = (INT32)val;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
long val = strtol(tok[1], NULL, 0);
|
long val = strtol(tok[1], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -559,7 +559,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
tok[3] = p + 1;
|
tok[3] = p + 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
{
|
{
|
||||||
long val = strtol(tok[0], NULL, 0);
|
long val = strtol(tok[0], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -567,7 +567,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
glyph->rectX = (INT32)val;
|
glyph->rectX = (INT32)val;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
long val = strtol(tok[1], NULL, 0);
|
long val = strtol(tok[1], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -575,7 +575,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
glyph->rectY = (INT32)val;
|
glyph->rectY = (INT32)val;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
long val = strtol(tok[2], NULL, 0);
|
long val = strtol(tok[2], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -583,7 +583,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, char* buffer,
|
|||||||
glyph->rectWidth = (INT32)val;
|
glyph->rectWidth = (INT32)val;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
long val = strtol(tok[3], NULL, 0);
|
long val = strtol(tok[3], nullptr, 0);
|
||||||
|
|
||||||
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
if ((errno != 0) || (val < INT32_MIN) || (val > INT32_MAX))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -644,9 +644,9 @@ static int rdtk_font_load_descriptor(rdtkFont* font, const char* filename)
|
|||||||
rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file)
|
rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file)
|
||||||
{
|
{
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
rdtkFont* font = NULL;
|
rdtkFont* font = nullptr;
|
||||||
char* fontImageFile = NULL;
|
char* fontImageFile = nullptr;
|
||||||
char* fontDescriptorFile = NULL;
|
char* fontDescriptorFile = nullptr;
|
||||||
|
|
||||||
WINPR_ASSERT(engine);
|
WINPR_ASSERT(engine);
|
||||||
WINPR_ASSERT(path);
|
WINPR_ASSERT(path);
|
||||||
@@ -703,7 +703,7 @@ cleanup:
|
|||||||
free(fontDescriptorFile);
|
free(fontDescriptorFile);
|
||||||
|
|
||||||
rdtk_font_free(font);
|
rdtk_font_free(font);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
WINPR_ATTR_MALLOC(rdtk_font_free, 1)
|
WINPR_ATTR_MALLOC(rdtk_font_free, 1)
|
||||||
@@ -719,7 +719,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, const uint8_t* image
|
|||||||
rdtkFont* font = (rdtkFont*)calloc(1, sizeof(rdtkFont));
|
rdtkFont* font = (rdtkFont*)calloc(1, sizeof(rdtkFont));
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
font->engine = engine;
|
font->engine = engine;
|
||||||
font->image = winpr_image_new();
|
font->image = winpr_image_new();
|
||||||
@@ -727,7 +727,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, const uint8_t* image
|
|||||||
if (!font->image)
|
if (!font->image)
|
||||||
{
|
{
|
||||||
free(font);
|
free(font);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int status = winpr_image_read_buffer(font->image, imageData, imageSize);
|
const int status = winpr_image_read_buffer(font->image, imageData, imageSize);
|
||||||
@@ -735,7 +735,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, const uint8_t* image
|
|||||||
{
|
{
|
||||||
winpr_image_free(font->image, TRUE);
|
winpr_image_free(font->image, TRUE);
|
||||||
free(font);
|
free(font);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = descriptorSize;
|
size = descriptorSize;
|
||||||
@@ -755,7 +755,7 @@ static rdtkFont* rdtk_embedded_font_new(rdtkEngine* engine, const uint8_t* image
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
rdtk_font_free(font);
|
rdtk_font_free(font);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdtk_font_free(rdtkFont* font)
|
void rdtk_font_free(rdtkFont* font)
|
||||||
@@ -774,8 +774,8 @@ int rdtk_font_engine_init(rdtkEngine* engine)
|
|||||||
WINPR_ASSERT(engine);
|
WINPR_ASSERT(engine);
|
||||||
if (!engine->font)
|
if (!engine->font)
|
||||||
{
|
{
|
||||||
const uint8_t* imageData = NULL;
|
const uint8_t* imageData = nullptr;
|
||||||
const uint8_t* descriptorData = NULL;
|
const uint8_t* descriptorData = nullptr;
|
||||||
const SSIZE_T imageSize =
|
const SSIZE_T imageSize =
|
||||||
rdtk_get_embedded_resource_file("source_serif_pro_regular_12." FILE_EXT, &imageData);
|
rdtk_get_embedded_resource_file("source_serif_pro_regular_12." FILE_EXT, &imageData);
|
||||||
const SSIZE_T descriptorSize =
|
const SSIZE_T descriptorSize =
|
||||||
@@ -799,7 +799,7 @@ int rdtk_font_engine_uninit(rdtkEngine* engine)
|
|||||||
if (engine->font)
|
if (engine->font)
|
||||||
{
|
{
|
||||||
rdtk_font_free(engine->font);
|
rdtk_font_free(engine->font);
|
||||||
engine->font = NULL;
|
engine->font = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ rdtkLabel* rdtk_label_new(rdtkEngine* engine)
|
|||||||
rdtkLabel* label = (rdtkLabel*)calloc(1, sizeof(rdtkLabel));
|
rdtkLabel* label = (rdtkLabel*)calloc(1, sizeof(rdtkLabel));
|
||||||
|
|
||||||
if (!label)
|
if (!label)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
label->engine = engine;
|
label->engine = engine;
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ int rdtk_label_engine_uninit(rdtkEngine* engine)
|
|||||||
if (engine->label)
|
if (engine->label)
|
||||||
{
|
{
|
||||||
rdtk_label_free(engine->label);
|
rdtk_label_free(engine->label);
|
||||||
engine->label = NULL;
|
engine->label = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ rdtkNinePatch* rdtk_nine_patch_new(rdtkEngine* engine)
|
|||||||
rdtkNinePatch* ninePatch = (rdtkNinePatch*)calloc(1, sizeof(rdtkNinePatch));
|
rdtkNinePatch* ninePatch = (rdtkNinePatch*)calloc(1, sizeof(rdtkNinePatch));
|
||||||
|
|
||||||
if (!ninePatch)
|
if (!ninePatch)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
ninePatch->engine = engine;
|
ninePatch->engine = engine;
|
||||||
return ninePatch;
|
return ninePatch;
|
||||||
@@ -512,7 +512,7 @@ void rdtk_nine_patch_free(rdtkNinePatch* ninePatch)
|
|||||||
int rdtk_nine_patch_engine_init(rdtkEngine* engine)
|
int rdtk_nine_patch_engine_init(rdtkEngine* engine)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
rdtkNinePatch* ninePatch = NULL;
|
rdtkNinePatch* ninePatch = nullptr;
|
||||||
|
|
||||||
WINPR_ASSERT(engine);
|
WINPR_ASSERT(engine);
|
||||||
|
|
||||||
@@ -520,8 +520,8 @@ int rdtk_nine_patch_engine_init(rdtkEngine* engine)
|
|||||||
|
|
||||||
{
|
{
|
||||||
SSIZE_T size = 0;
|
SSIZE_T size = 0;
|
||||||
const uint8_t* data = NULL;
|
const uint8_t* data = nullptr;
|
||||||
wImage* image = NULL;
|
wImage* image = nullptr;
|
||||||
|
|
||||||
status = -1;
|
status = -1;
|
||||||
size = rdtk_get_embedded_resource_file("btn_default_normal.9." FILE_EXT, &data);
|
size = rdtk_get_embedded_resource_file("btn_default_normal.9." FILE_EXT, &data);
|
||||||
@@ -553,11 +553,11 @@ int rdtk_nine_patch_engine_init(rdtkEngine* engine)
|
|||||||
|
|
||||||
if (!engine->textField9patch)
|
if (!engine->textField9patch)
|
||||||
{
|
{
|
||||||
const uint8_t* data = NULL;
|
const uint8_t* data = nullptr;
|
||||||
status = -1;
|
status = -1;
|
||||||
const SSIZE_T size =
|
const SSIZE_T size =
|
||||||
rdtk_get_embedded_resource_file("textfield_default.9." FILE_EXT, &data);
|
rdtk_get_embedded_resource_file("textfield_default.9." FILE_EXT, &data);
|
||||||
wImage* image = NULL;
|
wImage* image = nullptr;
|
||||||
|
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
@@ -593,13 +593,13 @@ int rdtk_nine_patch_engine_uninit(rdtkEngine* engine)
|
|||||||
if (engine->button9patch)
|
if (engine->button9patch)
|
||||||
{
|
{
|
||||||
rdtk_nine_patch_free(engine->button9patch);
|
rdtk_nine_patch_free(engine->button9patch);
|
||||||
engine->button9patch = NULL;
|
engine->button9patch = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine->textField9patch)
|
if (engine->textField9patch)
|
||||||
{
|
{
|
||||||
rdtk_nine_patch_free(engine->textField9patch);
|
rdtk_nine_patch_free(engine->textField9patch);
|
||||||
engine->textField9patch = NULL;
|
engine->textField9patch = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ rdtkSurface* rdtk_surface_new(rdtkEngine* engine, uint8_t* data, uint16_t width,
|
|||||||
rdtkSurface* surface = (rdtkSurface*)calloc(1, sizeof(rdtkSurface));
|
rdtkSurface* surface = (rdtkSurface*)calloc(1, sizeof(rdtkSurface));
|
||||||
|
|
||||||
if (!surface)
|
if (!surface)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
surface->engine = engine;
|
surface->engine = engine;
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ rdtkSurface* rdtk_surface_new(rdtkEngine* engine, uint8_t* data, uint16_t width,
|
|||||||
if (!surface->data)
|
if (!surface->data)
|
||||||
{
|
{
|
||||||
free(surface);
|
free(surface);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
surface->owner = true;
|
surface->owner = true;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ rdtkTextField* rdtk_text_field_new(rdtkEngine* engine, rdtkNinePatch* ninePatch)
|
|||||||
rdtkTextField* textField = (rdtkTextField*)calloc(1, sizeof(rdtkTextField));
|
rdtkTextField* textField = (rdtkTextField*)calloc(1, sizeof(rdtkTextField));
|
||||||
|
|
||||||
if (!textField)
|
if (!textField)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
textField->engine = engine;
|
textField->engine = engine;
|
||||||
textField->ninePatch = ninePatch;
|
textField->ninePatch = ninePatch;
|
||||||
@@ -126,7 +126,7 @@ int rdtk_text_field_engine_uninit(rdtkEngine* engine)
|
|||||||
if (engine->textField)
|
if (engine->textField)
|
||||||
{
|
{
|
||||||
rdtk_text_field_free(engine->textField);
|
rdtk_text_field_free(engine->textField);
|
||||||
engine->textField = NULL;
|
engine->textField = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
|
|
||||||
int TestRdTkNinePatch(int argc, char* argv[])
|
int TestRdTkNinePatch(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
rdtkEngine* engine = NULL;
|
rdtkEngine* engine = nullptr;
|
||||||
rdtkSurface* surface = NULL;
|
rdtkSurface* surface = nullptr;
|
||||||
uint32_t scanline = 0;
|
uint32_t scanline = 0;
|
||||||
uint32_t width = 0;
|
uint32_t width = 0;
|
||||||
uint32_t height = 0;
|
uint32_t height = 0;
|
||||||
uint8_t* data = NULL;
|
uint8_t* data = nullptr;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
WINPR_UNUSED(argc);
|
WINPR_UNUSED(argc);
|
||||||
@@ -28,14 +28,14 @@ int TestRdTkNinePatch(int argc, char* argv[])
|
|||||||
scanline = width * 4;
|
scanline = width * 4;
|
||||||
|
|
||||||
/* let rdtk allocate the surface buffer */
|
/* let rdtk allocate the surface buffer */
|
||||||
if (!(surface = rdtk_surface_new(engine, NULL, width, height, scanline)))
|
if (!(surface = rdtk_surface_new(engine, nullptr, width, height, scanline)))
|
||||||
{
|
{
|
||||||
printf("%s: error creating auto-allocated surface (%" PRIu32 ")\n", __func__,
|
printf("%s: error creating auto-allocated surface (%" PRIu32 ")\n", __func__,
|
||||||
GetLastError());
|
GetLastError());
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
rdtk_surface_free(surface);
|
rdtk_surface_free(surface);
|
||||||
surface = NULL;
|
surface = nullptr;
|
||||||
|
|
||||||
/* test self-allocated buffer */
|
/* test self-allocated buffer */
|
||||||
if (!(data = calloc(height, scanline)))
|
if (!(data = calloc(height, scanline)))
|
||||||
|
|||||||
@@ -35,15 +35,15 @@ int main(int argc, char** argv)
|
|||||||
int rc = 1;
|
int rc = 1;
|
||||||
int pf_count = 0;
|
int pf_count = 0;
|
||||||
XEvent event;
|
XEvent event;
|
||||||
XImage* image = NULL;
|
XImage* image = nullptr;
|
||||||
Pixmap pixmap = 0;
|
Pixmap pixmap = 0;
|
||||||
Window window = 0;
|
Window window = 0;
|
||||||
rdtkSurface* surface = NULL;
|
rdtkSurface* surface = nullptr;
|
||||||
|
|
||||||
WINPR_UNUSED(argc);
|
WINPR_UNUSED(argc);
|
||||||
WINPR_UNUSED(argv);
|
WINPR_UNUSED(argv);
|
||||||
|
|
||||||
Display* display = XOpenDisplay(NULL);
|
Display* display = XOpenDisplay(nullptr);
|
||||||
|
|
||||||
if (!display)
|
if (!display)
|
||||||
{
|
{
|
||||||
@@ -92,11 +92,11 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
if (rdtk_surface_fill(surface, 0, 0, width, height, 0x3BB9FF) < 0)
|
if (rdtk_surface_fill(surface, 0, 0, width, height, 0x3BB9FF) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (rdtk_label_draw(surface, 16, 16, 128, 32, NULL, "label", 0, 0) < 0)
|
if (rdtk_label_draw(surface, 16, 16, 128, 32, nullptr, "label", 0, 0) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (rdtk_button_draw(surface, 16, 64, 128, 32, NULL, "button") < 0)
|
if (rdtk_button_draw(surface, 16, 64, 128, 32, nullptr, "button") < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (rdtk_text_field_draw(surface, 16, 128, 128, 32, NULL, "text field") < 0)
|
if (rdtk_text_field_draw(surface, 16, 128, 128, 32, nullptr, "text field") < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
window = XCreateSimpleWindow(display, root_window, x, y, width, height, 1, border, background);
|
window = XCreateSimpleWindow(display, root_window, x, y, width, height, 1, border, background);
|
||||||
|
|||||||
Reference in New Issue
Block a user