mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-02 20:04:15 +01:00
wrlib: add explicit type definition in API to allow compiler Type Checks (3/3)
When defining enums as types instead of simple enums allows to use these types at the places where the corresponding enum values are expected, then allowing the compiler to check that, potentially reporting incorrect use of values to the user. This patch adds the type for the gradient style for RRender*Gradient. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
bc4084e679
commit
a772f2797d
@@ -556,7 +556,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
|
||||
|
||||
image = RRenderInterwovenGradient(width, height, c1, t1, c2, t2);
|
||||
} else if (strcasecmp(&type[1], "gradient") == 0) {
|
||||
int style;
|
||||
RGradientStyle style;
|
||||
RColor rcolor2;
|
||||
|
||||
switch (toupper(type[0])) {
|
||||
@@ -580,7 +580,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
|
||||
|
||||
image = RRenderGradient(width, height, &rcolor, &rcolor2, style);
|
||||
} else if (strcasecmp(&type[2], "gradient") == 0 && toupper(type[0]) == 'T') {
|
||||
int style;
|
||||
RGradientStyle style;
|
||||
RColor rcolor2;
|
||||
int i;
|
||||
RImage *grad = NULL;
|
||||
@@ -615,7 +615,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
|
||||
RReleaseImage(grad);
|
||||
|
||||
} else if (strcasecmp(&type[2], "gradient") == 0 && toupper(type[0]) == 'M') {
|
||||
int style;
|
||||
RGradientStyle style;
|
||||
RColor **colors;
|
||||
int i, j;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user