mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-17 06:35:47 +01:00
Added 'const' attribute on non-modified arguments for color handling functions
These functions have both an input and an output color, marked the input color as const to help distinguish.
This commit is contained in:
committed by
Carlos R. Mafra
parent
8f7d4b7751
commit
0bf6297a32
@@ -37,7 +37,7 @@
|
||||
#define MIN3(a,b,c) MIN(MIN(a,b), c)
|
||||
#define MAX3(a,b,c) MAX(MAX(a,b), c)
|
||||
|
||||
void RHSVtoRGB(RHSVColor * hsv, RColor * rgb)
|
||||
void RHSVtoRGB(const RHSVColor * hsv, RColor * rgb)
|
||||
{
|
||||
int h = hsv->hue % 360;
|
||||
int s = hsv->saturation;
|
||||
@@ -89,7 +89,7 @@ void RHSVtoRGB(RHSVColor * hsv, RColor * rgb)
|
||||
}
|
||||
}
|
||||
|
||||
void RRGBtoHSV(RColor * rgb, RHSVColor * hsv)
|
||||
void RRGBtoHSV(const RColor * rgb, RHSVColor * hsv)
|
||||
{
|
||||
int h, s, v;
|
||||
int max = MAX3(rgb->red, rgb->green, rgb->blue);
|
||||
|
||||
@@ -921,7 +921,7 @@ int RConvertImageMask(RContext * context, RImage * image, Pixmap * pixmap, Pixma
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool RGetClosestXColor(RContext * context, RColor * color, XColor * retColor)
|
||||
Bool RGetClosestXColor(RContext * context, const RColor * color, XColor * retColor)
|
||||
{
|
||||
if (context->vclass == TrueColor) {
|
||||
unsigned short rmask, gmask, bmask;
|
||||
|
||||
@@ -308,7 +308,7 @@ RContext *RCreateContext(Display *dpy, int screen_number,
|
||||
|
||||
void RDestroyContext(RContext *context);
|
||||
|
||||
Bool RGetClosestXColor(RContext *context, RColor *color, XColor *retColor);
|
||||
Bool RGetClosestXColor(RContext *context, const RColor *color, XColor *retColor);
|
||||
|
||||
/*
|
||||
* RImage creation
|
||||
@@ -407,8 +407,8 @@ void ROperateSegments(RImage *image, int operation, const RSegment *segs, int ns
|
||||
/*
|
||||
* Color convertion
|
||||
*/
|
||||
void RRGBtoHSV(RColor *color, RHSVColor *hsv);
|
||||
void RHSVtoRGB(RHSVColor *hsv, RColor *rgb);
|
||||
void RRGBtoHSV(const RColor *color, RHSVColor *hsv);
|
||||
void RHSVtoRGB(const RHSVColor *hsv, RColor *rgb);
|
||||
|
||||
/*
|
||||
* Painting
|
||||
|
||||
Reference in New Issue
Block a user