summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-08 08:43:42 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-09 21:04:50 +0000
commitabc17b0f8997ab07ae66130edd5dc8c43e72c886 (patch)
tree88056839c808a9f7f8c58f55ebe273aa7b5facdb /toxcore/tox.c
parent4e21c065517d6e125cb1d1b9a13e886b3046b0d8 (diff)
Factor out time keeping code into its own module: mono_time.c.
It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ```
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index c121eb2e..4c764aeb 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -518,6 +518,11 @@ static void set_friend_error(int32_t ret, Tox_Err_Friend_Add *error)
518 case FAERR_NOMEM: 518 case FAERR_NOMEM:
519 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_ADD_MALLOC); 519 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_ADD_MALLOC);
520 break; 520 break;
521
522 default:
523 /* can't happen */
524 assert(!"impossible: unknown friend-add error");
525 break;
521 } 526 }
522} 527}
523 528
@@ -826,7 +831,9 @@ static void set_message_error(int ret, Tox_Err_Friend_Send_Message *error)
826 break; 831 break;
827 832
828 case -5: 833 case -5:
834 default:
829 /* can't happen */ 835 /* can't happen */
836 assert(!"impossible: unknown send-message error");
830 break; 837 break;
831 } 838 }
832} 839}