summaryrefslogtreecommitdiff
path: root/include/kitchensink/kitsource.h
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-09-20 22:16:30 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-09-20 22:16:30 +0300
commit7c53bd1d66467af77cf1dfa127fff941bf916cb9 (patch)
treee86923401dc9713c64b5d9b17ed8bc2e80a7c657 /include/kitchensink/kitsource.h
parent735072f6469abdc59e448aa76a96d4eeb48fd2b5 (diff)
Improve code examples in documentation
Diffstat (limited to 'include/kitchensink/kitsource.h')
-rw-r--r--include/kitchensink/kitsource.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/kitchensink/kitsource.h b/include/kitchensink/kitsource.h
index 9b744ca..c410be1 100644
--- a/include/kitchensink/kitsource.h
+++ b/include/kitchensink/kitsource.h
@@ -110,7 +110,8 @@ typedef int64_t (*Kit_SeekCallback)(void *userdata, int64_t offset, int whence);
*
* For example:
* ```
- * if(Kit_CreateSourceFromUrl(filename) == NULL) {
+ * Kit_Source *src = Kit_CreateSourceFromUrl(filename);
+ * if(src == NULL) {
* fprintf(stderr, "Error: %s\n", Kit_GetError());
* return 1;
* }
@@ -133,7 +134,8 @@ KIT_API Kit_Source* Kit_CreateSourceFromUrl(const char *url);
*
* For example:
* ```
- * if(Kit_CreateSourceFromCustom(read_fn, seek_fn, fp) == NULL) {
+ * Kit_Source *src = Kit_CreateSourceFromCustom(read_fn, seek_fn, fp);
+ * if(src == NULL) {
* fprintf(stderr, "Error: %s\n", Kit_GetError());
* return 1;
* }
@@ -162,7 +164,8 @@ KIT_API Kit_Source* Kit_CreateSourceFromCustom(Kit_ReadCallback read_cb, Kit_See
* For example:
* ```
* SDL_RWops *rw = SDL_RWFromFile("myvideo.mkv", "rb");
- * if(Kit_CreateSourceFromRW(rw) == NULL) {
+ * Kit_Source *src = Kit_CreateSourceFromRW(rw);
+ * if(src == NULL) {
* fprintf(stderr, "Error: %s\n", Kit_GetError());
* return 1;
* }