Re: [3/5] secur32: Basic implementation of schannel AcquireCredentialsHandle/FreeCredentialsHandle
2008/9/22 Henri Verbeet <hverbeet(a)gmail.com>:
+static ULONG_PTR schan_alloc_handle(void *object, enum schan_handle_type type) +{ + struct schan_handle *handle; + + if (schan_free_handles) + { + /* Use a free handle */ + handle = schan_free_handles; + if (handle->type != SCHAN_HANDLE_FREE) + { + ERR("Handle %d(%p) is in the free list, but has type %#x.\n", (handle-schan_handle_table), handle, handle->type); + return -1; + }
Using a signed constant for an unsigned value isn't good practice. I'd recommend defining a constant at the top of the file like so: #define SCHANNEL_INVALID_HANDLE ~0UL And then using that everywhere that you use -1 now. -- Rob Shearman
2008/9/25 Rob Shearman <robertshearman(a)gmail.com>:
Using a signed constant for an unsigned value isn't good practice. I'd recommend defining a constant at the top of the file like so: #define SCHANNEL_INVALID_HANDLE ~0UL
And then using that everywhere that you use -1 now.
You're right on these, of course. Thanks for reviewing.
participants (2)
-
Henri Verbeet -
Rob Shearman