Change @return! syntax to require ":" after faults. Update all contracts to consistently use ":" before the description.

This commit is contained in:
Christoffer Lerno
2025-03-05 17:11:45 +01:00
parent cf0405930e
commit c0b80eccad
67 changed files with 645 additions and 637 deletions

View File

@@ -171,7 +171,7 @@ fn void remove_all_pool_threads(EventThreadPool* pool) @local
}
<*
@require size > 0 "Must have at least one thread"
@require size > 0 : "Must have at least one thread"
*>
fn EventThreadPool* EventThreadPool.init(&self, int size, String name, Allocator allocator, void* monitor_context)
{

View File

@@ -32,9 +32,9 @@ struct QueueItem @private
}
<*
@require !self.initialized "ThreadPool must not be already initialized"
@require threads > 0 && threads < 0x1000 `Threads should be greater than 0 and less than 0x1000`
@require queue_size < 0x10000 `Queue size must be less than 65536`
@require !self.initialized : "ThreadPool must not be already initialized"
@require threads > 0 && threads < 0x1000 : `Threads should be greater than 0 and less than 0x1000`
@require queue_size < 0x10000 : `Queue size must be less than 65536`
*>
fn void! FixedThreadPool.init(&self, usz threads, usz queue_size = 0)
{

View File

@@ -89,7 +89,7 @@ fn void! NativeMutex.lock(&mtx)
<*
@require mtx.timed "Only available for timed locks"
@require mtx.timed : "Only available for timed locks"
*>
fn void! NativeMutex.lock_timeout(&mtx, ulong ms)
{

View File

@@ -24,7 +24,7 @@ struct QueueItem @private
}
<*
@require !self.initialized "ThreadPool must not be already initialized"
@require !self.initialized : "ThreadPool must not be already initialized"
*>
fn void! ThreadPool.init(&self)
{