From 2d361228cd3c63bdbcc3bde6123321b3a61a6362 Mon Sep 17 00:00:00 2001 From: "Gregory Mullen (GrayHatter)" Date: Sat, 13 Feb 2016 20:23:29 -0800 Subject: SemVer toxav too --- toxav/toxav.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'toxav') diff --git a/toxav/toxav.c b/toxav/toxav.c index 448ce3f8..4c2cb4ef 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -106,24 +106,27 @@ void call_kill_transmission(ToxAVCall *call); uint32_t toxav_version_major(void) { - return 0; + return TOXAV_VERSION_MAJOR; } + uint32_t toxav_version_minor(void) { - return 0; + return TOXAV_VERSION_MINOR; } + uint32_t toxav_version_patch(void) { - return 0; + return TOXAV_VERSION_PATCH; } + bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) { - (void)major; - (void)minor; - (void)patch; - - return 1; + if (major != TOXAV_VERSION_MAJOR) + return 0; + else + return 1; } + ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) { TOXAV_ERR_NEW rc = TOXAV_ERR_NEW_OK; -- cgit v1.2.3 From 96bf594be5bd3524d5fb437be1444f9772bea827 Mon Sep 17 00:00:00 2001 From: "Gregory Mullen (GrayHatter)" Date: Sat, 13 Feb 2016 20:44:30 -0800 Subject: update the compatablity function to match the macro --- toxav/toxav.c | 9 +++++---- toxcore/tox.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'toxav') diff --git a/toxav/toxav.c b/toxav/toxav.c index 4c2cb4ef..7a883cf2 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -121,10 +121,11 @@ uint32_t toxav_version_patch(void) bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) { - if (major != TOXAV_VERSION_MAJOR) - return 0; - else - return 1; + return (TOXAV_VERSION_MAJOR == major && /* Force the major version */ + (TOXAV_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ + (TOXAV_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ + ) + ) } ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) diff --git a/toxcore/tox.c b/toxcore/tox.c index 3a9c4481..677fd112 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -87,10 +87,11 @@ uint32_t tox_version_patch(void) bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) { - if (major != TOX_VERSION_MAJOR) - return 0; - else - return 1; + return (TOX_VERSION_MAJOR == major && /* Force the major version */ + (TOX_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ + (TOX_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ + ) + ) } -- cgit v1.2.3 From ea21a541ff39570d87620d15e67e797e4fce0a2b Mon Sep 17 00:00:00 2001 From: "Gregory Mullen (GrayHatter)" Date: Sat, 13 Feb 2016 20:50:01 -0800 Subject: missed a line tox to toxav --- toxav/toxav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toxav') diff --git a/toxav/toxav.c b/toxav/toxav.c index 7a883cf2..a8fbbede 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -123,7 +123,7 @@ bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) { return (TOXAV_VERSION_MAJOR == major && /* Force the major version */ (TOXAV_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ - (TOXAV_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ + (TOXAV_VERSION_MINOR == minor && TOXAV_VERSION_PATCH >= patch) /* the patch must be the same or newer */ ) ) } -- cgit v1.2.3 From 9628f9d1711a096f771427e053443e908de365e4 Mon Sep 17 00:00:00 2001 From: "Gregory Mullen (GrayHatter)" Date: Sat, 13 Feb 2016 20:53:30 -0800 Subject: added the dropped ; --- toxav/toxav.c | 2 +- toxcore/tox.c | 2 +- toxencryptsave/toxencryptsave.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'toxav') diff --git a/toxav/toxav.c b/toxav/toxav.c index a8fbbede..814c4f26 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -125,7 +125,7 @@ bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) (TOXAV_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ (TOXAV_VERSION_MINOR == minor && TOXAV_VERSION_PATCH >= patch) /* the patch must be the same or newer */ ) - ) + ); } ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) diff --git a/toxcore/tox.c b/toxcore/tox.c index 677fd112..23d0d3e4 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -91,7 +91,7 @@ bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) (TOX_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ (TOX_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ ) - ) + ); } diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index 800d5d11..bbe0422f 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c @@ -68,7 +68,7 @@ bool toxes_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) (TOXES_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ (TOXES_VERSION_MINOR == minor && TOXES_VERSION_PATCH >= patch) /* the patch must be the same or newer */ ) - ) + ); } /* Clients should consider alerting their users that, unlike plain data, if even one bit -- cgit v1.2.3