1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

checksrc: Fixed line length and comment indentation

This commit is contained in:
Marc Hoersken 2012-09-14 00:44:16 +02:00
parent f73a27cadc
commit 8a2be299f4
3 changed files with 84 additions and 83 deletions

View File

@ -55,9 +55,9 @@ rtag_t gAllocTag = (rtag_t) NULL;
NXMutex_t *gLibLock = (NXMutex_t *) NULL; NXMutex_t *gLibLock = (NXMutex_t *) NULL;
/* internal library function prototypes... */ /* internal library function prototypes... */
int DisposeLibraryData ( void * ); int DisposeLibraryData( void * );
void DisposeThreadData ( void * ); void DisposeThreadData( void * );
int GetOrSetUpData ( int id, libdata_t **data, libthreaddata_t **threaddata ); int GetOrSetUpData( int id, libdata_t **data, libthreaddata_t **threaddata );
int _NonAppStart( void *NLMHandle, int _NonAppStart( void *NLMHandle,
@ -90,12 +90,12 @@ int _NonAppStart( void *NLMHandle,
#pragma unused(messages) #pragma unused(messages)
#endif #endif
/* /*
** Here we process our command line, post errors (to the error screen), * Here we process our command line, post errors (to the error screen),
** perform initializations and anything else we need to do before being able * perform initializations and anything else we need to do before being able
** to accept calls into us. If we succeed, we return non-zero and the NetWare * to accept calls into us. If we succeed, we return non-zero and the NetWare
** Loader will leave us up, otherwise we fail to load and get dumped. * Loader will leave us up, otherwise we fail to load and get dumped.
*/ */
gAllocTag = AllocateResourceTag(NLMHandle, gAllocTag = AllocateResourceTag(NLMHandle,
"<library-name> memory allocations", "<library-name> memory allocations",
AllocSignature); AllocSignature);
@ -126,9 +126,9 @@ int _NonAppStart( void *NLMHandle,
} }
/* /*
** Here we clean up any resources we allocated. Resource tags is a big part * Here we clean up any resources we allocated. Resource tags is a big part
** of what we created, but NetWare doesn't ask us to free those. * of what we created, but NetWare doesn't ask us to free those.
*/ */
void _NonAppStop( void ) void _NonAppStop( void )
{ {
(void) unregister_library(gLibId); (void) unregister_library(gLibId);
@ -136,16 +136,16 @@ void _NonAppStop( void )
} }
/* /*
** This function cannot be the first in the file for if the file is linked * This function cannot be the first in the file for if the file is linked
** first, then the check-unload function's offset will be nlmname.nlm+0 * first, then the check-unload function's offset will be nlmname.nlm+0
** which is how to tell that there isn't one. When the check function is * which is how to tell that there isn't one. When the check function is
** first in the linked objects, it is ambiguous. For this reason, we will * first in the linked objects, it is ambiguous. For this reason, we will
** put it inside this file after the stop function. * put it inside this file after the stop function.
** *
** Here we check to see if it's alright to ourselves to be unloaded. If not, * Here we check to see if it's alright to ourselves to be unloaded. If not,
** we return a non-zero value. Right now, there isn't any reason not to allow * we return a non-zero value. Right now, there isn't any reason not to allow
** it. * it.
*/ */
int _NonAppCheckUnload( void ) int _NonAppCheckUnload( void )
{ {
return 0; return 0;
@ -163,22 +163,22 @@ int GetOrSetUpData(int id, libdata_t **appData,
err = 0; err = 0;
thread_data = (libthreaddata_t *) NULL; thread_data = (libthreaddata_t *) NULL;
/* /*
** Attempt to get our data for the application calling us. This is where we * Attempt to get our data for the application calling us. This is where we
** store whatever application-specific information we need to carry in support * store whatever application-specific information we need to carry in
** of calling applications. * support of calling applications.
*/ */
app_data = (libdata_t *) get_app_data(id); app_data = (libdata_t *) get_app_data(id);
if(!app_data) { if(!app_data) {
/* /*
** This application hasn't called us before; set up application AND per-thread * This application hasn't called us before; set up application AND
** data. Of course, just in case a thread from this same application is calling * per-thread data. Of course, just in case a thread from this same
** us simultaneously, we better lock our application data-creation mutex. We * application is calling us simultaneously, we better lock our application
** also need to recheck for data after we acquire the lock because WE might be * data-creation mutex. We also need to recheck for data after we acquire
** that other thread that was too late to create the data and the first thread * the lock because WE might be that other thread that was too late to
** in will have created it. * create the data and the first thread in will have created it.
*/ */
NXLock(gLibLock); NXLock(gLibLock);
if(!(app_data = (libdata_t *) get_app_data(id))) { if(!(app_data = (libdata_t *) get_app_data(id))) {
@ -200,13 +200,14 @@ int GetOrSetUpData(int id, libdata_t **appData,
} }
if(app_data) { if(app_data) {
/* /*
** Here we burn in the application data that we were trying to get by calling * Here we burn in the application data that we were trying to get
** get_app_data(). Next time we call the first function, we'll get this data * by calling get_app_data(). Next time we call the first function,
** we're just now setting. We also go on here to establish the per-thread data * we'll get this data we're just now setting. We also go on here to
** for the calling thread, something we'll have to do on each application * establish the per-thread data for the calling thread, something
** thread the first time it calls us. * we'll have to do on each application thread the first time
*/ * it calls us.
*/
err = set_app_data(gLibId, app_data); err = set_app_data(gLibId, app_data);
if(err) { if(err) {
@ -236,13 +237,13 @@ int GetOrSetUpData(int id, libdata_t **appData,
if(key != -1 /* couldn't create a key? no thread data */ if(key != -1 /* couldn't create a key? no thread data */
&& !(err = NXKeyGetValue(key, (void **) &thread_data)) && !(err = NXKeyGetValue(key, (void **) &thread_data))
&& !thread_data) { && !thread_data) {
/* /*
** Allocate the per-thread data for the calling thread. Regardless of whether * Allocate the per-thread data for the calling thread. Regardless of
** there was already application data or not, this may be the first call by a * whether there was already application data or not, this may be the
** a new thread. The fact that we allocation 20 bytes on a pointer is not very * first call by a new thread. The fact that we allocation 20 bytes on
** important, this just helps to demonstrate that we can have arbitrarily * a pointer is not very important, this just helps to demonstrate that
** complex per-thread data. * we can have arbitrarily complex per-thread data.
*/ */
thread_data = malloc(sizeof(libthreaddata_t)); thread_data = malloc(sizeof(libthreaddata_t));
if(thread_data) { if(thread_data) {

View File

@ -562,7 +562,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
if(!socks5_resolve_local) { if(!socks5_resolve_local) {
socksreq[len++] = 3; /* ATYP: domain name = 3 */ socksreq[len++] = 3; /* ATYP: domain name = 3 */
socksreq[len++] = (char) hostname_len; /* address length */ socksreq[len++] = (char) hostname_len; /* address length */
memcpy(&socksreq[len], hostname, hostname_len); /* address bytes w/o NULL */ memcpy(&socksreq[len], hostname, hostname_len); /* address str w/o NULL */
len += hostname_len; len += hostname_len;
} }
else { else {
@ -592,7 +592,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
int i; int i;
if(hp->ai_family == AF_INET) { if(hp->ai_family == AF_INET) {
socksreq[len++] = 1; /* IPv4 = 1 */ socksreq[len++] = 1; /* ATYP: IPv4 = 1 */
saddr_in = (struct sockaddr_in*)hp->ai_addr; saddr_in = (struct sockaddr_in*)hp->ai_addr;
for(i = 0; i < 4; i++) { for(i = 0; i < 4; i++) {
@ -601,7 +601,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
} }
} }
else if(hp->ai_family == AF_INET6) { else if(hp->ai_family == AF_INET6) {
socksreq[len++] = 4; /* IPv6 = 4 */ socksreq[len++] = 4; /* ATYP: IPv6 = 4 */
saddr_in6 = (struct sockaddr_in6*)hp->ai_addr; saddr_in6 = (struct sockaddr_in6*)hp->ai_addr;
for(i = 0; i < 16; i++) { for(i = 0; i < 16; i++) {