Skip to content

Commit e2fc282

Browse files
committed
Add missing const specifiers to iconv functions
1 parent 785e609 commit e2fc282

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

units/sdl2.pas

+3-3
Original file line numberDiff line numberDiff line change
@@ -432,17 +432,17 @@ function SDL_SHAPEMODEALPHA(mode: TWindowShapeMode): Boolean;
432432
// from "sdl_stdinc.h"
433433

434434
// Note: We're using FPC's Strings.strlen() here, not SDL_strlen().
435-
function SDL_iconv_utf8_locale(str: PAnsiChar): PAnsiChar; cdecl;
435+
function SDL_iconv_utf8_locale(Const str: PAnsiChar): PAnsiChar; cdecl;
436436
begin
437437
Result := SDL_iconv_string('', 'UTF-8', str, Strings.strlen(str)+1)
438438
end;
439439

440-
function SDL_iconv_utf8_ucs2(str: PAnsiChar): pcUint16; cdecl;
440+
function SDL_iconv_utf8_ucs2(Const str: PAnsiChar): pcUint16; cdecl;
441441
begin
442442
Result := pcUint16(SDL_iconv_string('UCS-2-INTERNAL', 'UTF-8', str, Strings.strlen(str)+1))
443443
end;
444444

445-
function SDL_iconv_utf8_ucs4(str: PAnsiChar): pcUint32; cdecl;
445+
function SDL_iconv_utf8_ucs4(Const str: PAnsiChar): pcUint32; cdecl;
446446
begin
447447
Result := pcUint32(SDL_iconv_string('UCS-4-INTERNAL', 'UTF-8', str, Strings.strlen(str)+1))
448448
end;

units/sdlstdinc.inc

+6-6
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ procedure SDL_free(mem: Pointer); cdecl;
112112
*
113113
* \since This function is available since SDL 2.0.0.
114114
*)
115-
function SDL_iconv_string(tocode, fromcode, inbuf: PAnsiChar; inbytesleft: csize_t): PAnsiChar; cdecl
115+
function SDL_iconv_string(Const tocode, fromcode, inbuf: PAnsiChar; inbytesleft: csize_t): PAnsiChar; cdecl;
116116
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv_string' {$ENDIF} {$ENDIF};
117117

118118
// These are macros in the original C headers, we will reimplement them as simple Pascal functions.
119-
function SDL_iconv_utf8_locale(str: PAnsiChar): PAnsiChar; cdecl;
120-
function SDL_iconv_utf8_ucs2(str: PAnsiChar): pcUint16; cdecl;
121-
function SDL_iconv_utf8_ucs4(str: PAnsiChar): pcUint32; cdecl;
119+
function SDL_iconv_utf8_locale(Const str: PAnsiChar): PAnsiChar; cdecl;
120+
function SDL_iconv_utf8_ucs2(Const str: PAnsiChar): pcUint16; cdecl;
121+
function SDL_iconv_utf8_ucs4(Const str: PAnsiChar): pcUint32; cdecl;
122122

123123
(* The SDL implementation of iconv() returns these error codes *)
124124
const
@@ -131,11 +131,11 @@ type
131131
TSDL_iconv = record end;
132132
PSDL_iconv = ^TSDL_iconv;
133133

134-
function SDL_iconv_open(tocode, fromcode: PAnsiChar): PSDL_iconv; cdecl;
134+
function SDL_iconv_open(Const tocode, fromcode: PAnsiChar): PSDL_iconv; cdecl;
135135
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv_open' {$ENDIF} {$ENDIF};
136136

137137
function SDL_iconv_close(cd: PSDL_iconv): cint; cdecl;
138138
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv_close' {$ENDIF} {$ENDIF};
139139

140-
function SDL_iconv(cd: PSDL_iconv; inbuf: PPAnsiChar; inbytesleft: pcsize_t; outbuf: PPAnsiChar; outbytesleft: pcsize_t): csize_t; cdecl;
140+
function SDL_iconv(cd: PSDL_iconv; Const inbuf: PPAnsiChar; inbytesleft: pcsize_t; outbuf: PPAnsiChar; outbytesleft: pcsize_t): csize_t; cdecl;
141141
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv' {$ENDIF} {$ENDIF};

0 commit comments

Comments
 (0)