summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2021-09-25 22:01:43 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2021-09-25 22:01:43 +0200
commit93c741b938af10a81fbd55cf827456805bcf519a (patch)
tree5fa7e6b80eb5652af1a24adaca66c9f62d81cfc8
parentfixed roles (diff)
downloaddiscord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar.gz
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar.bz2
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar.lz
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar.xz
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.tar.zst
discord.c-93c741b938af10a81fbd55cf827456805bcf519a.zip
-rw-r--r--README.md1
-rw-r--r--src/api.c4
-rw-r--r--src/h.c1
3 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index 5ea70a4..36647f4 100644
--- a/README.md
+++ b/README.md
@@ -88,3 +88,4 @@ it would be useful to have an android port, and luckily this is possible with li
* optimization is always 0, binaries always have debug symbols
* `make -e CC=gcc` to choose a compiler instead of `cc`.
* `make -e CC="clang -fsanitize=address" && ASAN_OPTIONS=detect_leaks=1` to use `clang` leak checker
+* `scan-build make` to staticly analyze build with `clang` (`clang-tools` package required). `gcc`'s `-fanalyze` can't be used without many false positives, because the code is not written so pedantically (without `__attribute__`s on function arguments, return values, ...).
diff --git a/src/api.c b/src/api.c
index 7171e3a..a9d9f77 100644
--- a/src/api.c
+++ b/src/api.c
@@ -135,8 +135,8 @@ signed char dc_json_cb (struct lejp_ctx * ctx, char reason) { /* to prevent warn
}
if (path == DC_JSON_DM && reason == LEJPCB_OBJECT_END) {
struct dc_channel ** channel = &client->guilds[0]->channel; /* 1. guild = DMs */
- while (*channel)
- channel = &(*channel)->next;
+ while (*channel) /* a ni to malo kremž? zakaj dodajam na konec, če bi lahko samo */
+ channel = &(*channel)->next; /* dodal na začetek v O(1) */
if (!pass->api_io.channel->id) {
dc_channel_free(pass->api_io.channel, DC_UNSET);
pass->api_io.channel = NULL;
diff --git a/src/h.c b/src/h.c
index df7907f..7ace971 100644
--- a/src/h.c
+++ b/src/h.c
@@ -1,4 +1,3 @@
-/* note: ISAs will (hopefully) no longer be used in my programs in favour of linked lists */
/* ISAs: _sizeof means size of array, _length means usable/initialized members in array */
#define DC_ISA(type, name) type ** name; size_t name##_sizeof; size_t name##_length /* in struct array */
#define DC_ALLOC_CHUNK 1