(API Change) Use const params where applicable
This Fixes a minor flaw with the API where data had to always be mutable to be usable by the API. Functions that do not modify the fundamental underlying data of a structure should be marked as constant, both for safety and to signify that the parameter is input only and will not be modified by the function using it.
This commit is contained in:
@@ -186,17 +186,18 @@ failed:
|
||||
|
||||
#endif
|
||||
|
||||
uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_width(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
return stagesurf->width;
|
||||
}
|
||||
|
||||
uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf)
|
||||
uint32_t gs_stagesurface_get_height(const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
return stagesurf->height;
|
||||
}
|
||||
|
||||
enum gs_color_format gs_stagesurface_get_color_format(gs_stagesurf_t *stagesurf)
|
||||
enum gs_color_format gs_stagesurface_get_color_format(
|
||||
const gs_stagesurf_t *stagesurf)
|
||||
{
|
||||
return stagesurf->format;
|
||||
}
|
||||
|
Reference in New Issue
Block a user