Skip to content

Commit b4e96fe

Browse files
committed
inc: Add CONSTs to crt/string.bi and crt/mem.bi
(cherry picked from commit 79581dd)
1 parent 40814f9 commit b4e96fe

File tree

3 files changed

+53
-52
lines changed

3 files changed

+53
-52
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Version 1.02.1
1212
- 1.02.0 regression: Windows API binding: REFIID and some other REF* types were missing; wsprintf/wvsprintf declarations were missing
1313
- bindings: Various previously untranslated (or wrongly translated) #defines in SDL2, X11, crt/pthread, Windows API
1414
- Windows API binding: DirectX headers missed some declarations and some didn't compile
15+
- crt/string.bi, crt/mem.bi: Added CONSTs to function declarations
1516

1617

1718
Version 1.02.0

inc/crt/mem.bi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
extern "C"
66

7-
declare function memchr (byval as any ptr, byval as long, byval as size_t) as any ptr
8-
declare function memcmp (byval as any ptr, byval as any ptr, byval as size_t) as long
9-
declare function memcpy (byval as any ptr, byval as any ptr, byval as size_t) as any ptr
10-
declare function memmove (byval as any ptr, byval as any ptr, byval as size_t) as any ptr
7+
declare function memchr (byval as const any ptr, byval as long, byval as size_t) as any ptr
8+
declare function memcmp (byval as const any ptr, byval as const any ptr, byval as size_t) as long
9+
declare function memcpy (byval as any ptr, byval as const any ptr, byval as size_t) as any ptr
10+
declare function memmove (byval as any ptr, byval as const any ptr, byval as size_t) as any ptr
1111
declare function memset (byval as any ptr, byval as long, byval as size_t) as any ptr
1212

1313
end extern

inc/crt/string.bi

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,68 +14,68 @@
1414

1515
extern "c"
1616

17-
declare function strcat (byval as zstring ptr, byval as zstring ptr) as zstring ptr
18-
declare function strchr (byval as zstring ptr, byval as long) as zstring ptr
19-
declare function strcmp (byval as zstring ptr, byval as zstring ptr) as long
20-
declare function strcoll (byval as zstring ptr, byval as zstring ptr) as long
21-
declare function strcpy (byval as zstring ptr, byval as zstring ptr) as zstring ptr
22-
declare function strcspn (byval as zstring ptr, byval as zstring ptr) as size_t
17+
declare function strcat (byval as zstring ptr, byval as const zstring ptr) as zstring ptr
18+
declare function strchr (byval as const zstring ptr, byval as long) as zstring ptr
19+
declare function strcmp (byval as const zstring ptr, byval as const zstring ptr) as long
20+
declare function strcoll (byval as const zstring ptr, byval as const zstring ptr) as long
21+
declare function strcpy (byval as zstring ptr, byval as const zstring ptr) as zstring ptr
22+
declare function strcspn (byval as const zstring ptr, byval as const zstring ptr) as size_t
2323
declare function strerror (byval as long) as zstring ptr
24-
declare function strlen (byval as zstring ptr) as size_t
25-
declare function strncat (byval as zstring ptr, byval as zstring ptr, byval as size_t) as zstring ptr
26-
declare function strncmp (byval as zstring ptr, byval as zstring ptr, byval as size_t) as long
27-
declare function strncpy (byval as zstring ptr, byval as zstring ptr, byval as size_t) as zstring ptr
28-
declare function strpbrk (byval as zstring ptr, byval as zstring ptr) as zstring ptr
29-
declare function strrchr (byval as zstring ptr, byval as long) as zstring ptr
30-
declare function strspn (byval as zstring ptr, byval as zstring ptr) as size_t
31-
declare function strstr (byval as zstring ptr, byval as zstring ptr) as zstring ptr
32-
declare function strtok (byval as zstring ptr, byval as zstring ptr) as zstring ptr
33-
declare function strxfrm (byval as zstring ptr, byval as zstring ptr, byval as size_t) as size_t
34-
declare function wcscat (byval as wchar_t ptr, byval as wchar_t ptr) as wchar_t ptr
35-
declare function wcschr (byval as wchar_t ptr, byval as wchar_t) as wchar_t ptr
36-
declare function wcscmp (byval as wchar_t ptr, byval as wchar_t ptr) as long
37-
declare function wcscoll (byval as wchar_t ptr, byval as wchar_t ptr) as long
38-
declare function wcscpy (byval as wchar_t ptr, byval as wchar_t ptr) as wchar_t ptr
39-
declare function wcscspn (byval as wchar_t ptr, byval as wchar_t ptr) as size_t
40-
declare function wcslen (byval as wchar_t ptr) as size_t
41-
declare function wcsncat (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as wchar_t ptr
42-
declare function wcsncmp (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as long
43-
declare function wcsncpy (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as wchar_t ptr
44-
declare function wcspbrk (byval as wchar_t ptr, byval as wchar_t ptr) as wchar_t ptr
45-
declare function wcsrchr (byval as wchar_t ptr, byval as wchar_t) as wchar_t ptr
46-
declare function wcsspn (byval as wchar_t ptr, byval as wchar_t ptr) as size_t
47-
declare function wcsstr (byval as wchar_t ptr, byval as wchar_t ptr) as wchar_t ptr
48-
declare function wcstok (byval as wchar_t ptr, byval as wchar_t ptr) as wchar_t ptr
49-
declare function wcsxfrm (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as size_t
24+
declare function strlen (byval as const zstring ptr) as size_t
25+
declare function strncat (byval as zstring ptr, byval as const zstring ptr, byval as size_t) as zstring ptr
26+
declare function strncmp (byval as const zstring ptr, byval as const zstring ptr, byval as size_t) as long
27+
declare function strncpy (byval as zstring ptr, byval as const zstring ptr, byval as size_t) as zstring ptr
28+
declare function strpbrk (byval as const zstring ptr, byval as const zstring ptr) as zstring ptr
29+
declare function strrchr (byval as const zstring ptr, byval as long) as zstring ptr
30+
declare function strspn (byval as const zstring ptr, byval as const zstring ptr) as size_t
31+
declare function strstr (byval as const zstring ptr, byval as const zstring ptr) as zstring ptr
32+
declare function strtok (byval as zstring ptr, byval as const zstring ptr) as zstring ptr
33+
declare function strxfrm (byval as zstring ptr, byval as const zstring ptr, byval as size_t) as size_t
34+
declare function wcscat (byval as wchar_t ptr, byval as const wchar_t ptr) as wchar_t ptr
35+
declare function wcschr (byval as const wchar_t ptr, byval as wchar_t) as wchar_t ptr
36+
declare function wcscmp (byval as const wchar_t ptr, byval as const wchar_t ptr) as long
37+
declare function wcscoll (byval as const wchar_t ptr, byval as const wchar_t ptr) as long
38+
declare function wcscpy (byval as wchar_t ptr, byval as const wchar_t ptr) as wchar_t ptr
39+
declare function wcscspn (byval as const wchar_t ptr, byval as const wchar_t ptr) as size_t
40+
declare function wcslen (byval as const wchar_t ptr) as size_t
41+
declare function wcsncat (byval as wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as wchar_t ptr
42+
declare function wcsncmp (byval as const wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as long
43+
declare function wcsncpy (byval as wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as wchar_t ptr
44+
declare function wcspbrk (byval as const wchar_t ptr, byval as const wchar_t ptr) as wchar_t ptr
45+
declare function wcsrchr (byval as const wchar_t ptr, byval as wchar_t) as wchar_t ptr
46+
declare function wcsspn (byval as const wchar_t ptr, byval as const wchar_t ptr) as size_t
47+
declare function wcsstr (byval as const wchar_t ptr, byval as const wchar_t ptr) as wchar_t ptr
48+
declare function wcstok (byval as wchar_t ptr, byval as const wchar_t ptr) as wchar_t ptr
49+
declare function wcsxfrm (byval as wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as size_t
5050

5151
#ifdef __FB_WIN32__
52-
declare function _strerror (byval as zstring ptr) as zstring ptr
53-
declare function _memccpy (byval as any ptr, byval as any ptr, byval as long, byval as size_t) as any ptr
54-
declare function _memicmp (byval as any ptr, byval as any ptr, byval as size_t) as long
55-
declare function _strdup (byval as zstring ptr) as zstring ptr
56-
declare function _strcmpi (byval as zstring ptr, byval as zstring ptr) as long
57-
declare function _stricmp (byval as zstring ptr, byval as zstring ptr) as long
58-
declare function _stricoll (byval as zstring ptr, byval as zstring ptr) as long
52+
declare function _strerror (byval as const zstring ptr) as zstring ptr
53+
declare function _memccpy (byval as any ptr, byval as const any ptr, byval as long, byval as size_t) as any ptr
54+
declare function _memicmp (byval as const any ptr, byval as const any ptr, byval as size_t) as long
55+
declare function _strdup (byval as const zstring ptr) as zstring ptr
56+
declare function _strcmpi (byval as const zstring ptr, byval as const zstring ptr) as long
57+
declare function _stricmp (byval as const zstring ptr, byval as const zstring ptr) as long
58+
declare function _stricoll (byval as const zstring ptr, byval as const zstring ptr) as long
5959
declare function _strlwr (byval as zstring ptr) as zstring ptr
60-
declare function _strnicmp (byval as zstring ptr, byval as zstring ptr, byval as size_t) as long
60+
declare function _strnicmp (byval as const zstring ptr, byval as const zstring ptr, byval as size_t) as long
6161
declare function _strnset (byval as zstring ptr, byval as long, byval as size_t) as zstring ptr
6262
declare function _strrev (byval as zstring ptr) as zstring ptr
6363
declare function _strset (byval as zstring ptr, byval as long) as zstring ptr
6464
declare function _strupr (byval as zstring ptr) as zstring ptr
6565
declare sub _swab (byval as zstring ptr, byval as zstring ptr, byval as size_t)
66-
declare function _strncoll (byval as zstring ptr, byval as zstring ptr, byval as size_t) as long
67-
declare function _strnicoll (byval as zstring ptr, byval as zstring ptr, byval as size_t) as long
68-
declare function _wcsdup (byval as wchar_t ptr) as wchar_t ptr
69-
declare function _wcsicmp (byval as wchar_t ptr, byval as wchar_t ptr) as long
70-
declare function _wcsicoll (byval as wchar_t ptr, byval as wchar_t ptr) as long
66+
declare function _strncoll (byval as const zstring ptr, byval as const zstring ptr, byval as size_t) as long
67+
declare function _strnicoll (byval as const zstring ptr, byval as const zstring ptr, byval as size_t) as long
68+
declare function _wcsdup (byval as const wchar_t ptr) as wchar_t ptr
69+
declare function _wcsicmp (byval as const wchar_t ptr, byval as const wchar_t ptr) as long
70+
declare function _wcsicoll (byval as const wchar_t ptr, byval as const wchar_t ptr) as long
7171
declare function _wcslwr (byval as wchar_t ptr) as wchar_t ptr
72-
declare function _wcsnicmp (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as long
72+
declare function _wcsnicmp (byval as const wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as long
7373
declare function _wcsnset (byval as wchar_t ptr, byval as wchar_t, byval as size_t) as wchar_t ptr
7474
declare function _wcsrev (byval as wchar_t ptr) as wchar_t ptr
7575
declare function _wcsset (byval as wchar_t ptr, byval as wchar_t) as wchar_t ptr
7676
declare function _wcsupr (byval as wchar_t ptr) as wchar_t ptr
77-
declare function _wcsncoll (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as long
78-
declare function _wcsnicoll (byval as wchar_t ptr, byval as wchar_t ptr, byval as size_t) as long
77+
declare function _wcsncoll (byval as const wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as long
78+
declare function _wcsnicoll (byval as const wchar_t ptr, byval as const wchar_t ptr, byval as size_t) as long
7979
#endif
8080

8181
end extern

0 commit comments

Comments
 (0)