if () => if()

while () => while()
and some other minor re-indentings
This commit is contained in:
Daniel Stenberg
2007-11-07 09:21:35 +00:00
parent 33f7ac06c3
commit cbd1a77ec2
38 changed files with 356 additions and 351 deletions

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -38,7 +38,7 @@ curl_share_init(void)
{
struct Curl_share *share =
(struct Curl_share *)malloc(sizeof(struct Curl_share));
if (share) {
if(share) {
memset (share, 0, sizeof(struct Curl_share));
share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
}
@@ -56,7 +56,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
curl_unlock_function unlockfunc;
void *ptr;
if (share->dirty)
if(share->dirty)
/* don't allow setting options while one or more handles are already
using this share */
return CURLSHE_IN_USE;
@@ -70,7 +70,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
share->specifier |= (1<<type);
switch( type ) {
case CURL_LOCK_DATA_DNS:
if (!share->hostcache) {
if(!share->hostcache) {
share->hostcache = Curl_mk_dnscache();
if(!share->hostcache)
return CURLSHE_NOMEM;
@@ -79,7 +79,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
case CURL_LOCK_DATA_COOKIE:
if (!share->cookies) {
if(!share->cookies) {
share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE );
if(!share->cookies)
return CURLSHE_NOMEM;
@@ -102,7 +102,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
switch( type )
{
case CURL_LOCK_DATA_DNS:
if (share->hostcache) {
if(share->hostcache) {
Curl_hash_destroy(share->hostcache);
share->hostcache = NULL;
}
@@ -110,7 +110,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
case CURL_LOCK_DATA_COOKIE:
if (share->cookies) {
if(share->cookies) {
Curl_cookie_cleanup(share->cookies);
share->cookies = NULL;
}
@@ -155,14 +155,14 @@ curl_share_cleanup(CURLSH *sh)
{
struct Curl_share *share = (struct Curl_share *)sh;
if (share == NULL)
if(share == NULL)
return CURLSHE_INVALID;
if(share->lockfunc)
share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE,
share->clientdata);
if (share->dirty) {
if(share->dirty) {
if(share->unlockfunc)
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
return CURLSHE_IN_USE;
@@ -190,7 +190,7 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
{
struct Curl_share *share = data->share;
if (share == NULL)
if(share == NULL)
return CURLSHE_INVALID;
if(share->specifier & (1<<type)) {
@@ -207,7 +207,7 @@ Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
{
struct Curl_share *share = data->share;
if (share == NULL)
if(share == NULL)
return CURLSHE_INVALID;
if(share->specifier & (1<<type)) {