aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/xcms
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/xcms')
-rw-r--r--libX11/src/xcms/CCC.c5
-rw-r--r--libX11/src/xcms/CvCols.c6
-rw-r--r--libX11/src/xcms/IdOfPr.c2
-rw-r--r--libX11/src/xcms/LRGB.c36
-rw-r--r--libX11/src/xcms/SetGetCols.c10
-rw-r--r--libX11/src/xcms/StCols.c4
-rw-r--r--libX11/src/xcms/cmsCmap.c11
-rw-r--r--libX11/src/xcms/cmsColNm.c8
-rw-r--r--libX11/src/xcms/cmsInt.c11
9 files changed, 45 insertions, 48 deletions
diff --git a/libX11/src/xcms/CCC.c b/libX11/src/xcms/CCC.c
index 090b1078c..de6d6318a 100644
--- a/libX11/src/xcms/CCC.c
+++ b/libX11/src/xcms/CCC.c
@@ -111,7 +111,7 @@ XcmsCreateCCC(
XcmsPerScrnInfo *pNewScrnInfo;
if (pDefaultCCC == NULL ||
- !(newccc = (XcmsCCC) Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) {
+ !(newccc = Xcalloc(1, sizeof(XcmsCCCRec)))) {
return(NULL);
}
@@ -144,8 +144,7 @@ XcmsCreateCCC(
* If one exists replace the pPerScrnInfo.
*/
if ((pIMap = _XcmsGetIntensityMap(dpy, visual)) != NULL) {
- if (!(pNewScrnInfo = (XcmsPerScrnInfo *)
- Xcalloc(1, (unsigned) sizeof(XcmsPerScrnInfo)))) {
+ if (!(pNewScrnInfo = Xcalloc(1, sizeof(XcmsPerScrnInfo)))) {
Xfree(newccc);
return(NULL);
}
diff --git a/libX11/src/xcms/CvCols.c b/libX11/src/xcms/CvCols.c
index ed3582663..87d49311c 100644
--- a/libX11/src/xcms/CvCols.c
+++ b/libX11/src/xcms/CvCols.c
@@ -796,7 +796,7 @@ XcmsConvertColors(
* Make copy of array of color specifications
*/
if (nColors > 1) {
- pColors_tmp = (XcmsColor *) Xmalloc(nColors * sizeof(XcmsColor));
+ pColors_tmp = Xmalloc(nColors * sizeof(XcmsColor));
} else {
pColors_tmp = &Color1;
}
@@ -987,13 +987,13 @@ XcmsConvertColors(
nColors * sizeof(XcmsColor));
}
if (nColors > 1) {
- Xfree((char *)pColors_tmp);
+ Xfree(pColors_tmp);
}
return(retval);
Failure:
if (nColors > 1) {
- Xfree((char *)pColors_tmp);
+ Xfree(pColors_tmp);
}
return(XcmsFailure);
}
diff --git a/libX11/src/xcms/IdOfPr.c b/libX11/src/xcms/IdOfPr.c
index 3a92e0a11..e15f34fec 100644
--- a/libX11/src/xcms/IdOfPr.c
+++ b/libX11/src/xcms/IdOfPr.c
@@ -67,7 +67,7 @@ XcmsFormatOfPrefix(char *prefix)
* While copying prefix to string_lowered, convert to lowercase
*/
if ((len = strlen(prefix)) >= sizeof(string_buf)) {
- string_lowered = (char *) Xmalloc(len+1);
+ string_lowered = Xmalloc(len+1);
} else {
string_lowered = string_buf;
}
diff --git a/libX11/src/xcms/LRGB.c b/libX11/src/xcms/LRGB.c
index 5ecb7d120..461d07d87 100644
--- a/libX11/src/xcms/LRGB.c
+++ b/libX11/src/xcms/LRGB.c
@@ -511,7 +511,7 @@ LINEAR_RGB_InitSCCData(
*pValue++ = (long)_XcmsGetElement(format_return, &pChar,
&nitems) / (XcmsFloat)XDCCC_NUMBER;
}
- Xfree ((char *)property_return);
+ Xfree (property_return);
pPerScrnInfo->screenWhitePt.spec.CIEXYZ.X =
pScreenData->RGBtoXYZmatrix[0][0] +
pScreenData->RGBtoXYZmatrix[0][1] +
@@ -662,7 +662,7 @@ LINEAR_RGB_InitSCCData(
/* Create, initialize, and add map */
if (!(pNewMap = (XcmsIntensityMap *)
Xcalloc (1, sizeof(XcmsIntensityMap)))) {
- Xfree((char *)pScreenData);
+ Xfree(pScreenData);
goto Free_property_return;
}
pNewMap->visualID = visualID;
@@ -782,7 +782,7 @@ LINEAR_RGB_InitSCCData(
#endif /* ALLDEBUG */
}
- Xfree ((char *)property_return);
+ Xfree (property_return);
/* Free the old memory and use the new structure created. */
LINEAR_RGB_FreeSCCData(pPerScrnInfo->screenData);
@@ -796,28 +796,28 @@ LINEAR_RGB_InitSCCData(
return(XcmsSuccess);
FreeBlueTblElements:
- Xfree((char *)pScreenData->pBlueTbl->pBase);
+ Xfree(pScreenData->pBlueTbl->pBase);
FreeBlueTbl:
- Xfree((char *)pScreenData->pBlueTbl);
+ Xfree(pScreenData->pBlueTbl);
FreeGreenTblElements:
- Xfree((char *)pScreenData->pGreenTbl->pBase);
+ Xfree(pScreenData->pGreenTbl->pBase);
FreeGreenTbl:
- Xfree((char *)pScreenData->pGreenTbl);
+ Xfree(pScreenData->pGreenTbl);
FreeRedTblElements:
- Xfree((char *)pScreenData->pRedTbl->pBase);
+ Xfree(pScreenData->pRedTbl->pBase);
FreeRedTbl:
- Xfree((char *)pScreenData->pRedTbl);
+ Xfree(pScreenData->pRedTbl);
Free_property_return:
- Xfree ((char *)property_return);
+ Xfree (property_return);
FreeSCCData:
- Xfree((char *)pScreenDefaultData);
+ Xfree(pScreenDefaultData);
pPerScrnInfo->state = XcmsInitNone;
return(XcmsFailure);
}
@@ -849,30 +849,30 @@ LINEAR_RGB_FreeSCCData(
if (pScreenData->pRedTbl->pBase !=
pScreenData->pGreenTbl->pBase) {
if (pScreenData->pGreenTbl->pBase) {
- Xfree ((char *)pScreenData->pGreenTbl->pBase);
+ Xfree (pScreenData->pGreenTbl->pBase);
}
}
if (pScreenData->pGreenTbl != pScreenData->pRedTbl) {
- Xfree ((char *)pScreenData->pGreenTbl);
+ Xfree (pScreenData->pGreenTbl);
}
}
if (pScreenData->pBlueTbl) {
if (pScreenData->pRedTbl->pBase !=
pScreenData->pBlueTbl->pBase) {
if (pScreenData->pBlueTbl->pBase) {
- Xfree ((char *)pScreenData->pBlueTbl->pBase);
+ Xfree (pScreenData->pBlueTbl->pBase);
}
}
if (pScreenData->pBlueTbl != pScreenData->pRedTbl) {
- Xfree ((char *)pScreenData->pBlueTbl);
+ Xfree (pScreenData->pBlueTbl);
}
}
if (pScreenData->pRedTbl->pBase) {
- Xfree ((char *)pScreenData->pRedTbl->pBase);
+ Xfree (pScreenData->pRedTbl->pBase);
}
- Xfree ((char *)pScreenData->pRedTbl);
+ Xfree (pScreenData->pRedTbl);
}
- Xfree ((char *)pScreenData);
+ Xfree (pScreenData);
}
}
diff --git a/libX11/src/xcms/SetGetCols.c b/libX11/src/xcms/SetGetCols.c
index 9b548dbb2..83fa4c200 100644
--- a/libX11/src/xcms/SetGetCols.c
+++ b/libX11/src/xcms/SetGetCols.c
@@ -237,7 +237,7 @@ _XcmsSetGetColors(
/*
* Allocate space for XColors
*/
- if ((pXColors_in_out = (XColor *)Xcalloc(nColors, sizeof(XColor))) ==
+ if ((pXColors_in_out = Xcalloc(nColors, sizeof(XColor))) ==
NULL) {
return(XcmsFailure);
}
@@ -251,7 +251,7 @@ _XcmsSetGetColors(
*/
if ((retval = XcmsConvertColors(ccc, pColors_in_out, nColors, XcmsRGBFormat,
pCompressed)) == XcmsFailure) {
- Xfree((char *)pXColors_in_out);
+ Xfree(pXColors_in_out);
return(XcmsFailure);
}
@@ -268,12 +268,12 @@ Query:
/* Note: XQueryColors and XStoreColors do not return any Status */
(*xColorProc)(ccc->dpy, cmap, pXColors_in_out, nColors);
} else {
- Xfree((char *)pXColors_in_out);
+ Xfree(pXColors_in_out);
return(XcmsFailure);
}
if (*xColorProc == XStoreColors) {
- Xfree((char *)pXColors_in_out);
+ Xfree(pXColors_in_out);
return(retval);
}
@@ -281,7 +281,7 @@ Query:
* Now, convert the returned XColor (i.e., rgb) to XcmsColor structures
*/
_XColor_to_XcmsRGB(ccc, pXColors_in_out, pColors_in_out, nColors);
- Xfree((char *)pXColors_in_out);
+ Xfree(pXColors_in_out);
/*
* Then, convert XcmsColor structures to the original specification
diff --git a/libX11/src/xcms/StCols.c b/libX11/src/xcms/StCols.c
index 24ccd386f..42a29cd7f 100644
--- a/libX11/src/xcms/StCols.c
+++ b/libX11/src/xcms/StCols.c
@@ -85,7 +85,7 @@ XcmsStoreColors(
* overwrite the contents.
*/
if (nColors > 1) {
- pColors_tmp = (XcmsColor *) Xmalloc(nColors * sizeof(XcmsColor));
+ pColors_tmp = Xmalloc(nColors * sizeof(XcmsColor));
} else {
pColors_tmp = &Color1;
}
@@ -102,7 +102,7 @@ XcmsStoreColors(
* Free copies as needed.
*/
if (nColors > 1) {
- Xfree((char *)pColors_tmp);
+ Xfree(pColors_tmp);
}
/*
diff --git a/libX11/src/xcms/cmsCmap.c b/libX11/src/xcms/cmsCmap.c
index 00816ce03..c5401c05d 100644
--- a/libX11/src/xcms/cmsCmap.c
+++ b/libX11/src/xcms/cmsCmap.c
@@ -191,7 +191,7 @@ CmapRecForColormap(
SyncHandle();
} while (async_state.error_count > 0 && ++j < nVisualsMatched);
- Xfree((char *)visualList);
+ Xfree(visualList);
/*
* if successful
@@ -250,8 +250,7 @@ _XcmsAddCmapRec(
{
XcmsCmapRec *pNew;
- if ((pNew = (XcmsCmapRec *) Xcalloc(1, (unsigned) sizeof(XcmsCmapRec)))
- == NULL) {
+ if ((pNew = Xcalloc(1, sizeof(XcmsCmapRec))) == NULL) {
return((XcmsCmapRec *)NULL);
}
@@ -301,7 +300,7 @@ _XcmsCopyCmapRecAndFree(
pRec_copy =_XcmsAddCmapRec(dpy, copy_cmap, pRec_src->windowID,
pRec_src->visual);
if (pRec_copy != NULL && pRec_src->ccc) {
- pRec_copy->ccc = (XcmsCCC)Xcalloc(1, (unsigned) sizeof(XcmsCCCRec));
+ pRec_copy->ccc = Xcalloc(1, sizeof(XcmsCCCRec));
memcpy((char *)pRec_copy->ccc, (char *)pRec_src->ccc,
sizeof(XcmsCCCRec));
}
@@ -353,7 +352,7 @@ _XcmsDeleteCmapRec(
XcmsFreeCCC(pRec->ccc);
}
*pPrevPtr = pRec->pNext;
- Xfree((char *)pRec);
+ Xfree(pRec);
}
}
@@ -388,7 +387,7 @@ _XcmsFreeClientCmaps(
XcmsFreeCCC(pRecFree->ccc);
}
/* Now free the XcmsCmapRec structure */
- Xfree((char *)pRecFree);
+ Xfree(pRecFree);
}
dpy->cms.clientCmaps = (XPointer)NULL;
}
diff --git a/libX11/src/xcms/cmsColNm.c b/libX11/src/xcms/cmsColNm.c
index 8d0d4a771..ecf19b37e 100644
--- a/libX11/src/xcms/cmsColNm.c
+++ b/libX11/src/xcms/cmsColNm.c
@@ -209,7 +209,7 @@ _XcmsParseColorString(
* While copying color_string to string_lowered, convert to lowercase
*/
if ((len = strlen(color_string)) >= sizeof(string_buf)) {
- string_lowered = (char *) Xmalloc(len+1);
+ string_lowered = Xmalloc(len+1);
} else {
string_lowered = string_buf;
}
@@ -418,7 +418,7 @@ _XcmsLookupColorName(
Retry:
if ((len = strlen(tmpName)) > 63) {
- name_lowered = (char *) Xmalloc(len+1);
+ name_lowered = Xmalloc(len+1);
} else {
name_lowered = name_lowered_64;
}
@@ -760,8 +760,8 @@ LoadColornameDB(void)
}
rewind(stream);
- strings = (char *) Xmalloc(size);
- pairs = (XcmsPair *)Xcalloc(nEntries, sizeof(XcmsPair));
+ strings = Xmalloc(size);
+ pairs = Xcalloc(nEntries, sizeof(XcmsPair));
ReadColornameDB(stream, pairs, strings);
(void) fclose(stream);
diff --git a/libX11/src/xcms/cmsInt.c b/libX11/src/xcms/cmsInt.c
index b7c321472..f4aef04ff 100644
--- a/libX11/src/xcms/cmsInt.c
+++ b/libX11/src/xcms/cmsInt.c
@@ -82,7 +82,7 @@ _XcmsCopyPointerArray(
for (tmp = pap, n = 0; *tmp != NULL; tmp++, n++);
n++; /* add 1 to include the NULL pointer */
- if ((newArray = (XPointer *)Xmalloc(n * sizeof(XPointer)))) {
+ if ((newArray = Xmalloc(n * sizeof(XPointer)))) {
memcpy((char *)newArray, (char *)pap,
(unsigned)(n * sizeof(XPointer)));
}
@@ -141,7 +141,7 @@ _XcmsPushPointerArray(
/* add 2: 1 for the new pointer and another for the NULL pointer */
n += 2;
- if ((newArray = (XPointer *)Xmalloc(n * sizeof(XPointer)))) {
+ if ((newArray = Xmalloc(n * sizeof(XPointer)))) {
memcpy((char *)(newArray+1),(char *)pap,
(unsigned)((n-1) * sizeof(XPointer)));
*newArray = p;
@@ -183,8 +183,7 @@ _XcmsInitDefaultCCCs(
* Create an array of XcmsCCC structures, one for each screen.
* They serve as the screen's default CCC.
*/
- if (!(ccc = (XcmsCCC)
- Xcalloc((unsigned)nScrn, (unsigned) sizeof(XcmsCCCRec)))) {
+ if (!(ccc = Xcalloc((unsigned)nScrn, sizeof(XcmsCCCRec)))) {
return(0);
}
dpy->cms.defaultCCCs = (XPointer)ccc;
@@ -322,8 +321,8 @@ _XcmsInitScrnInfo(
* for the latter (see XcmsCreateCCC). The ones created
* here are referenced by the default CCC.
*/
- if (!(defaultccc->pPerScrnInfo = (XcmsPerScrnInfo *)
- Xcalloc(1, (unsigned) sizeof(XcmsPerScrnInfo)))) {
+ if (!(defaultccc->pPerScrnInfo =
+ Xcalloc(1, sizeof(XcmsPerScrnInfo)))) {
return(0);
}
defaultccc->pPerScrnInfo->state = XcmsInitNone;