mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-13 12:25:53 +01:00
WUtil: Added 'const' attribute to all remaining functions where applicable
This makes the WUtil API as much const-correct as possible for the arguments being given to its functions. This does not make it totally correct as it does not changes the const-ness on returned values because the goal of this patch is to make no visible change to existing program that would use this library.
This commit is contained in:
committed by
Carlos R. Mafra
parent
d40fa69b92
commit
74c17bffae
@@ -67,7 +67,7 @@ WMData *WMCreateDataWithLength(unsigned length)
|
||||
return aData;
|
||||
}
|
||||
|
||||
WMData *WMCreateDataWithBytes(void *bytes, unsigned length)
|
||||
WMData *WMCreateDataWithBytes(const void *bytes, unsigned length)
|
||||
{
|
||||
WMData *aData;
|
||||
|
||||
@@ -230,7 +230,7 @@ unsigned WMGetDataLength(WMData * aData)
|
||||
}
|
||||
|
||||
/* Adding data */
|
||||
void WMAppendDataBytes(WMData * aData, void *bytes, unsigned length)
|
||||
void WMAppendDataBytes(WMData * aData, const void *bytes, unsigned length)
|
||||
{
|
||||
unsigned oldLength = aData->length;
|
||||
unsigned newLength = oldLength + length;
|
||||
@@ -260,7 +260,7 @@ void WMAppendData(WMData * aData, WMData * anotherData)
|
||||
|
||||
/* Modifying data */
|
||||
|
||||
void WMReplaceDataBytesInRange(WMData * aData, WMRange aRange, void *bytes)
|
||||
void WMReplaceDataBytesInRange(WMData * aData, WMRange aRange, const void *bytes)
|
||||
{
|
||||
wassertr(aRange.position < aData->length);
|
||||
wassertr(aRange.count <= aData->length - aRange.position);
|
||||
|
||||
Reference in New Issue
Block a user