ObjFW  Check-in [c065201231]

Overview
Comment:Merge trunk into branch "amiga-library"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: c0652012311167f8f29787c7e5d7077172083ed2d5086ebd4d41f74c4709b65a
User & Date: js on 2022-11-17 17:22:19
Other Links: branch diff | manifest | tags
Context
2022-11-17
17:26
Only ignore -Warray-parameter with GCC >= 11 check-in: 8ed68c3f28 user: js tags: amiga-library
17:22
Merge trunk into branch "amiga-library" check-in: c065201231 user: js tags: amiga-library
17:15
More consistency between the two amiga-library.m check-in: 0846f898ea user: js tags: amiga-library
14:50
Fix embedded files with GCC check-in: 722bb308e8 user: js tags: trunk
Changes

Modified src/OFEmbeddedURIHandler.h from [b6c4c9f6e5] to [c72607aa86].

25
26
27
28
29
30
31
32


33
34
35
36
37
38
39
#endif
/**
 * @brief Register a file for the `embedded:` URI scheme.
 *
 * Usually, you should not use the directly, but rather generate a source file
 * for a file to be embedded using the `objfw-embed` tool.
 *
 * @param path The path to the file under the `embedded:` scheme


 * @param bytes The raw bytes for the file
 * @param size The size of the file
 */
extern void OFRegisterEmbeddedFile(OFString *path, const uint8_t *bytes,
    size_t size);
#ifdef __cplusplus
}







|
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#endif
/**
 * @brief Register a file for the `embedded:` URI scheme.
 *
 * Usually, you should not use the directly, but rather generate a source file
 * for a file to be embedded using the `objfw-embed` tool.
 *
 * @param path The path to the file under the `embedded:` scheme. This is not
 *	       retained, so you must either pass a constant string or pass a
 *	       string that is already retained!
 * @param bytes The raw bytes for the file
 * @param size The size of the file
 */
extern void OFRegisterEmbeddedFile(OFString *path, const uint8_t *bytes,
    size_t size);
#ifdef __cplusplus
}

Modified src/OFEmbeddedURIHandler.m from [36019fb356] to [1976c624c2].

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
	OFEnsure(OFPlainMutexLock(&mutex) == 0);
#endif

	embeddedFiles = realloc(embeddedFiles,
	    sizeof(*embeddedFiles) * (numEmbeddedFiles + 1));
	OFEnsure(embeddedFiles != NULL);

	embeddedFiles[numEmbeddedFiles].path = [path retain];
	embeddedFiles[numEmbeddedFiles].bytes = bytes;
	embeddedFiles[numEmbeddedFiles].size = size;
	numEmbeddedFiles++;

#ifdef OF_HAVE_THREADS
	OFEnsure(OFPlainMutexUnlock(&mutex) == 0);
#endif







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
	OFEnsure(OFPlainMutexLock(&mutex) == 0);
#endif

	embeddedFiles = realloc(embeddedFiles,
	    sizeof(*embeddedFiles) * (numEmbeddedFiles + 1));
	OFEnsure(embeddedFiles != NULL);

	embeddedFiles[numEmbeddedFiles].path = path;
	embeddedFiles[numEmbeddedFiles].bytes = bytes;
	embeddedFiles[numEmbeddedFiles].size = size;
	numEmbeddedFiles++;

#ifdef OF_HAVE_THREADS
	OFEnsure(OFPlainMutexUnlock(&mutex) == 0);
#endif