From 90cc8d398a07c66e6bbe151961a2e73697dfacd1 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Sat, 28 Jan 2012 17:27:57 +1000 Subject: [PATCH] Whitespace cleanup in src [f-l] Signed-off-by: Steve Youngs --- src/fileio.c | 38 ++++++++++---------- src/filelock.c | 2 +- src/fns.c | 38 ++++++++++---------- src/gdbinit | 1 - src/getloadavg.c | 2 +- src/hftctl.c | 10 +++--- src/indent.c | 2 +- src/libsst.c | 2 +- src/lisp-disunion.h | 12 +++---- src/lisp.h | 48 +++++++++++++------------- src/lread.c | 84 ++++++++++++++++++++++----------------------- src/lrecord.h | 2 +- src/lstream.c | 6 ++-- src/lstream.h | 2 +- 14 files changed, 124 insertions(+), 125 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 63b1959..5595770 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -448,7 +448,7 @@ Bytecount file_basename_match_extension(Lisp_Object filename, Bytecount match = -1; Bytecount len = XSTRING_LENGTH( extension ); if ( len > 0 ) { - char re[len+6], + char re[len+6], *rep = re; Bufbyte *ext = XSTRING_DATA(extension); Lisp_Object regexp; @@ -465,7 +465,7 @@ Bytecount file_basename_match_extension(Lisp_Object filename, terminator if need to append... */ rep += len-1; - if ( *rep++ != '$' ) + if ( *rep++ != '$' ) *rep++ = '$'; *rep = '\0'; regexp = make_string( (Bufbyte*)re, strlen(re)); @@ -519,7 +519,7 @@ It ignores trailing slash. res = make_string(p, end - p); if ( STRINGP( extension ) ) { Bytecount match; - match = file_basename_match_extension(res, + match = file_basename_match_extension(res, extension); if ( match >= 0 ) RETURN_UNGCPRO(make_string(p, match)); @@ -528,7 +528,7 @@ It ignores trailing slash. do { ext = XCAR(rest); Bytecount match; - match = file_basename_match_extension(res, + match = file_basename_match_extension(res, ext); if ( match >= 0 ) RETURN_UNGCPRO(make_string(p, match)); @@ -1093,7 +1093,7 @@ in the realpath() function. { Lisp_Object handler = Ffind_file_name_handler(expanded_name, Qfile_truename); - + if (!NILP(handler)) RETURN_UNGCPRO (call2_check_string @@ -1114,11 +1114,11 @@ in the realpath() function. goto toolong; /* Try doing it all at once. */ - /* !! Does realpath() Mule-encapsulate? Answer: Nope! + /* !! Does realpath() Mule-encapsulate? Answer: Nope! So we do it above */ if (path != NULL && !xrealpath((char *)path, resolved_path)) { /* Didn't resolve it -- have to do it one - component at a time. + component at a time. "realpath" is a typically useless, stupid un*x piece of crap. It claims to return a @@ -1141,7 +1141,7 @@ in the realpath() function. Since we depend on undocumented semantics of various system realpath()s, we just use - our own version in realpath.c. + our own version in realpath.c. */ for (;;) { Extbyte *pos = NULL; @@ -1160,7 +1160,7 @@ in the realpath() function. *p = DIRECTORY_SEP; else break; - + } else if (errno == ENOENT || errno == EACCES) { /* Failed on this component. Just tack on the rest of @@ -1174,13 +1174,13 @@ in the realpath() function. places in resolved_path the absolute pathname of the path component which could - not be resolved." + not be resolved." */ if (p == NULL ) { break; } int plen = elen - (p - path); - + if (rlen > 1 && IS_DIRECTORY_SEP (resolved_path[rlen - 1])) @@ -1203,10 +1203,10 @@ in the realpath() function. Lisp_Object resolved_name; int rlen = strlen(resolved_path); - if (elen > 0 + if (elen > 0 && IS_DIRECTORY_SEP( - XSTRING_BYTE(expanded_name, elen-1)) - && !(rlen > 0 && + XSTRING_BYTE(expanded_name, elen-1)) + && !(rlen > 0 && IS_DIRECTORY_SEP(resolved_path[rlen-1]))) { if (rlen + 1 > countof(resolved_path)) goto toolong; @@ -1636,9 +1636,9 @@ Create a directory. One argument, a file name string. } strncpy(dir, (char *)XSTRING_DATA(dirname_), XSTRING_LENGTH(dirname_) + 1); - dir[XSTRING_LENGTH(dirname_)]='\0'; + dir[XSTRING_LENGTH(dirname_)]='\0'; if (dir[XSTRING_LENGTH(dirname_) - 1] == '/') - dir[XSTRING_LENGTH(dirname_) - 1] = '\0'; + dir[XSTRING_LENGTH(dirname_) - 1] = '\0'; if (mkdir(dir, 0777) != 0) report_file_error("Creating directory", list1(dirname_)); @@ -3068,13 +3068,13 @@ here because write-region handler writers need to be aware of it. to avoid a "file has changed on disk" warning on next attempt to save. */ if (visiting) - if (stat_res == 0) + if (stat_res == 0) current_buffer->modtime = st.st_mtime; - /* else: + /* else: If sxemacs_stat failed, we have bigger problems, and most likely the file is gone, so the error next time is the right behavior - */ + */ if (failure) { errno = save_errno; diff --git a/src/filelock.c b/src/filelock.c index f353f13..957236e 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -334,7 +334,7 @@ void lock_file(Lisp_Object fn) max_sz = strlen(lock_info.user) + strlen(lock_info.host) + LOCK_PID_MAX + 9; locker = (char *)alloca(max_sz); - sz = snprintf(locker, max_sz, "%s@%s (pid %lu)", + sz = snprintf(locker, max_sz, "%s@%s (pid %lu)", lock_info.user, lock_info.host, lock_info.pid); assert(sz>=0 && sz < max_sz); diff --git a/src/fns.c b/src/fns.c index ed1884b..7a332a4 100644 --- a/src/fns.c +++ b/src/fns.c @@ -147,11 +147,11 @@ Return a pseudo-random number. All integers representable in Lisp are equally likely. On most systems, this is 31 bits' worth. -With positive integer argument LIMIT, return random number +With positive integer argument LIMIT, return random number in interval [0,LIMIT). LIMIT can be a big integer, in which case the range of possible values is extended. -With argument t, set the random number seed from the +With argument t, set the random number seed from the current time and pid. */ (limit)) @@ -698,8 +698,8 @@ concat(int nargs, Lisp_Object * args, Bufbyte *string_result_ptr = NULL; struct gcpro gcpro1; int speccount = specpdl_depth(); - Charcount total_length; - + Charcount total_length; + /* The modus operandi in Emacs is "caller gc-protects args". However, concat is called many times in Emacs on freshly @@ -716,7 +716,7 @@ concat(int nargs, Lisp_Object * args, the result in the returned string's `string-translatable' property. */ #endif if (target_type == c_string) - XMALLOC_OR_ALLOCA(args_mse, nargs, struct merge_string_extents_struct); + XMALLOC_OR_ALLOCA(args_mse, nargs, struct merge_string_extents_struct); /* In append, the last arg isn't treated like the others */ if (last_special && nargs > 0) { @@ -758,7 +758,7 @@ concat(int nargs, Lisp_Object * args, /* Charcount is a misnomer here as we might be dealing with the length of a vector or list, but emphasizes that we're not dealing with Bytecounts in strings */ - /* Charcount total_length; */ + /* Charcount total_length; */ for (argnum = 0, total_length = 0; argnum < nargs; argnum++) { #ifdef LOSING_BYTECODE @@ -772,21 +772,21 @@ concat(int nargs, Lisp_Object * args, switch (target_type) { case c_cons: - if (total_length == 0) { + if (total_length == 0) { /* In append, if all but last arg are nil, return last arg */ - XMALLOC_UNBIND(args_mse, nargs, speccount); + XMALLOC_UNBIND(args_mse, nargs, speccount); RETURN_UNGCPRO(last_tail); - } + } val = Fmake_list(make_int(total_length), Qnil); break; case c_dllist: - if (total_length == 0) { + if (total_length == 0) { /* In append, if all but last arg are nil, return last arg */ - XMALLOC_UNBIND(args_mse, nargs, speccount); + XMALLOC_UNBIND(args_mse, nargs, speccount); RETURN_UNGCPRO(last_tail); - } + } val = Fmake_list(make_int(total_length), Qnil); break; case c_vector: @@ -807,7 +807,7 @@ concat(int nargs, Lisp_Object * args, in order to make the char fit properly. O(N^2) yuckage. */ val = Qnil; - XMALLOC_ATOMIC_OR_ALLOCA( string_result, + XMALLOC_ATOMIC_OR_ALLOCA( string_result, total_length * MAX_EMCHAR_LEN, Bufbyte ); string_result_ptr = string_result; @@ -889,7 +889,7 @@ concat(int nargs, Lisp_Object * args, XINT(elt)); } else { CHECK_CHAR_COERCE_INT(elt); - if(string_result_ptr != NULL) { + if(string_result_ptr != NULL) { string_result_ptr += set_charptr_emchar(string_result_ptr, XCHAR(elt)); @@ -1013,7 +1013,7 @@ END may be nil or omitted; then the substring runs to the end of STRING. If START or END is negative, it counts from the end. Relevant parts of the string-extent-data are copied to the new string. */ - (string, start, end)) + (string, start, end)) { Charcount ccstart, ccend; Bytecount bstart, blen; @@ -1898,7 +1898,7 @@ list_merge(Lisp_Object org_l1, Lisp_Object org_l2, } /************************************************************************/ -/* property-list functions */ +/* property-list functions */ /************************************************************************/ /* For properties of text, we need to do order-insensitive comparison of @@ -2747,7 +2747,7 @@ internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth) const struct lrecord_implementation *imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1), *imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2); - + /* #### not yet implemented properly, needs another flag to specify equalp-ness */ return (imp1 == imp2) && @@ -3276,7 +3276,7 @@ static short base64_char_to_value[128] = { .--------. .--------. .--------. |aaaaaabb| |bbbbcccc| |ccdddddd| `--------' `--------' `--------' - 6 2 4 4 2 6 + 6 2 4 4 2 6 .--------+--------+--------+--------. |00aaaaaa|00bbbbbb|00cccccc|00dddddd| `--------+--------+--------+--------' @@ -3635,7 +3635,7 @@ base16_decode_1(Lstream * istream, int length, Bufbyte * to) low = ec - 'A' + 10; else if (islower(ec)) low = ec - 'a' + 10; - else + else ignore_p = 1; if (low < 0 || low >= 16) diff --git a/src/gdbinit b/src/gdbinit index fefb2a4..315fd7b 100644 --- a/src/gdbinit +++ b/src/gdbinit @@ -492,4 +492,3 @@ define test_pobj printf "Vsxemacs_codename: " pobj Vsxemacs_codename end - diff --git a/src/getloadavg.c b/src/getloadavg.c index d4c6a13..6b514fe 100644 --- a/src/getloadavg.c +++ b/src/getloadavg.c @@ -51,7 +51,7 @@ along with this program. If not, see . */ UMAX UMAX4_3 __linux__ Linux: assumes /proc filesystem mounted. - Support from Michael K. Johnson. + Support from Michael K. Johnson. __NetBSD__ NetBSD: assumes /kern filesystem mounted. __OpenBSD__ OpenBSD: ditto. diff --git a/src/hftctl.c b/src/hftctl.c index 87b6c66..af41561 100644 --- a/src/hftctl.c +++ b/src/hftctl.c @@ -103,11 +103,11 @@ static struct hfctlack ACK = /* read a buffer */ #define RD_BUF(f,p,l) \ - while ((l)) \ - if ((j = read((f),(p),(l))) < 0) \ - if (errno != EINTR) return (-1); \ - else continue; \ - else { (l) -= j; (p) += j; } + while ((l)) \ + if ((j = read((f),(p),(l))) < 0) \ + if (errno != EINTR) return (-1); \ + else continue; \ + else { (l) -= j; (p) += j; } /*************** function prototypes ***************************/ #ifdef __STDC__ diff --git a/src/indent.c b/src/indent.c index d0c303b..ec802b2 100644 --- a/src/indent.c +++ b/src/indent.c @@ -575,7 +575,7 @@ static int vpix_motion(line_start_cache_dynarr * cache, int start, int end) /* Least bad thing in case of in fatal_failure, where assert will not terminate this function... */ return 0; - } + } vpix = 0; for (i = start; i <= end; i++) diff --git a/src/libsst.c b/src/libsst.c index ce6d3ad..1c6d095 100644 --- a/src/libsst.c +++ b/src/libsst.c @@ -309,7 +309,7 @@ int fd, dhz1, dhz2, thz, rhz, usec; else { dval1 = (dhz1 * 128 + 63) / 1000; if ((dval1 < 1) || (dval1 > 255)) { - int sz = snprintf(buf, sizeof(buf), + int sz = snprintf(buf, sizeof(buf), "sst_tones: dhz1 %d out of range", dhz1); assert(sz >= 0 && sz < sizeof(buf)); warn(buf); diff --git a/src/lisp-disunion.h b/src/lisp-disunion.h index 4dd1be5..2525d62 100644 --- a/src/lisp-disunion.h +++ b/src/lisp-disunion.h @@ -24,17 +24,17 @@ along with this program. If not, see . */ /* Format of a non-union-type Lisp Object - 3 2 1 0 + 3 2 1 0 bit 10987654321098765432109876543210 - -------------------------------- - VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTT + -------------------------------- + VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTT Integers are treated specially, and look like this: - 3 2 1 0 + 3 2 1 0 bit 10987654321098765432109876543210 - -------------------------------- - VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVT + -------------------------------- + VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVT For integral Lisp types, i.e. integers and characters, the value bits are the Lisp object. Some people call such Lisp_Objects "immediate". diff --git a/src/lisp.h b/src/lisp.h index e41c4c8..a858a9e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -512,7 +512,7 @@ extern Lisp_Object Qnil; { LIST_LOOP_3 (elt, list, tail) { - execute_code_here; + execute_code_here; } } @@ -640,7 +640,7 @@ PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \ #define PRIVATE_EXTERNAL_LIST_LOOP_6(elt, list, len, hare, \ tortoise, suspicion_length) \ for (tortoise = hare = list, len = 0; \ - \ + \ (CONSP (hare) ? ((elt = XCAR (hare)), 1) : \ (NILP (hare) ? 0 : \ (signal_malformed_list_error (list), 0))); \ @@ -719,7 +719,7 @@ do { \ list = XCDR (tail_##elt); \ else \ XCDR (prev_tail_##elt) = XCDR (tail_##elt); \ - /* Keep tortoise from ever passing hare. */ \ + /* Keep tortoise from ever passing hare. */ \ len_##elt = 0; \ } \ else \ @@ -842,7 +842,7 @@ EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail, \ tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare, \ - tortoise, suspicion_length) \ + tortoise, suspicion_length) \ for (tortoise = hare = list, len = 0; \ \ ((CONSP (hare) && \ @@ -2319,18 +2319,18 @@ void debug_gcpro5(char *, int, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *); void debug_gcpro6(char *, int, struct gcpro *, struct gcpro *, struct gcpro *, - struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, - Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, - Lisp_Object *); + struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, + Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, + Lisp_Object *); void debug_gcpro7(char *, int, struct gcpro *, struct gcpro *, struct gcpro *, - struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, - Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, - Lisp_Object *, Lisp_Object *, Lisp_Object *); + struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, + Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, + Lisp_Object *, Lisp_Object *, Lisp_Object *); void debug_gcpro8(char *, int, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, - struct gcpro *, Lisp_Object *, Lisp_Object *, - Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, - Lisp_Object *, Lisp_Object *); + struct gcpro *, Lisp_Object *, Lisp_Object *, + Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, + Lisp_Object *, Lisp_Object *); void debug_ungcpro(char *, int, struct gcpro *); #define GCPRO1(v) \ @@ -2347,13 +2347,13 @@ void debug_ungcpro(char *, int, struct gcpro *); &v1,&v2,&v3,&v4,&v5) #define GCPRO6(v1,v2,v3,v4,v5,v6) \ debug_gcpro6 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,&gcpro5,&gcpro6, \ - &v1,&v2,&v3,&v4,&v5,&v6) + &v1,&v2,&v3,&v4,&v5,&v6) #define GCPRO7(v1,v2,v3,v4,v5,v6,v7) \ debug_gcpro7 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,&gcpro5,&gcpro6,&gcpro7,\ &v1,&v2,&v3,&v4,&v5,&v6,&v7) #define GCPRO8(v1,v2,v3,v4,v5,v6,v7,v8) \ debug_gcpro8 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,&gcpro5,&gcpro6,&gcpro7,&gcpro8, \ - &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) + &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) #define UNGCPRO \ debug_ungcpro(__FILE__, __LINE__,&gcpro1) @@ -2371,13 +2371,13 @@ void debug_ungcpro(char *, int, struct gcpro *); &ngcpro5,&v1,&v2,&v3,&v4,&v5) #define NGCPRO6(v1,v2,v3,v4,v5,v6) \ debug_gcpro6 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,&ngcpro5,&ngcpro6, \ - &v1,&v2,&v3,&v4,&v5,&v6) + &v1,&v2,&v3,&v4,&v5,&v6) #define NGCPRO7(v1,v2,v3,v4,v5,v6,v7) \ debug_gcpro7 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,&ngcpro5,&ngcpro6,&ngcpro7,\ &v1,&v2,&v3,&v4,&v5,&v6,&v7) #define NGCPRO8(v1,v2,v3,v4,v5,v6,v7,v8) \ debug_gcpro8 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,&ngcpro5,&ngcpro6,&ngcpro7,&ngcpro8, \ - &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) + &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) #define NUNGCPRO \ debug_ungcpro(__FILE__, __LINE__,&ngcpro1) @@ -2395,13 +2395,13 @@ void debug_ungcpro(char *, int, struct gcpro *); &nngcpro5,&v1,&v2,&v3,&v4,&v5) #define NNGCPRO6(v1,v2,v3,v4,v5,v6) \ debug_gcpro6 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,&nngcpro5,&nngcpro6, \ - &v1,&v2,&v3,&v4,&v5,&v6) + &v1,&v2,&v3,&v4,&v5,&v6) #define NNGCPRO7(v1,v2,v3,v4,v5,v6,v7) \ debug_gcpro7 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,&nngcpro5,&nngcpro6,&nngcpro7,\ &v1,&v2,&v3,&v4,&v5,&v6,&v7) #define NNGCPRO8(v1,v2,v3,v4,v5,v6,v7,v8) \ debug_gcpro8 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,&nngcpro5,&nngcpro6,&nngcpro7,&nngcpro8, \ - &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) + &v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8) #define NNUNGCPRO \ debug_ungcpro(__FILE__, __LINE__,&nngcpro1) @@ -2690,12 +2690,12 @@ typedef unsigned long uintptr_t; #endif /************************************************************************/ -/* Misc definitions */ +/* Misc definitions */ /************************************************************************/ #include "dllist.h" /************************************************************************/ -/* Other numeric types */ +/* Other numeric types */ /************************************************************************/ /* more allocation goodies, C99 wise */ @@ -3047,8 +3047,8 @@ Lisp_Object call1_trapping_errors(char*, Lisp_Object, Lisp_Object); Lisp_Object call2_trapping_errors(char*, Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object call3_trapping_errors(char*, - Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); + Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object); Lisp_Object call_with_suspended_errors(lisp_fn_t, volatile Lisp_Object, Lisp_Object, Error_behavior, int, ...); /* C Code should be using internal_catch, record_unwind_p, condition_case_1 */ @@ -3269,7 +3269,7 @@ void print_symbol(Lisp_Object, Lisp_Object, int); * representation of an integral type. Add a few bytes for truncation, * optional sign prefix, and null byte terminator. * 2.40824 == log (256) / log (10). - * + * * We don't use floating point since Sun cc (buggily?) cannot use * floating point computations to define a compile-time integral * constant. diff --git a/src/lread.c b/src/lread.c index 2642141..4354541 100644 --- a/src/lread.c +++ b/src/lread.c @@ -717,8 +717,8 @@ encoding detection or end-of-line detection. struct gcpro ngcpro1; NGCPRO1(lstrm); - if (fd < 0) - signal_file_error("Cannot open load file", file); + if (fd < 0) + signal_file_error("Cannot open load file", file); lstrm = make_filedesc_input_stream(fd, 0, -1, LSTR_CLOSING); /* 64K is used for normal files; 8K should be OK here because @@ -940,12 +940,12 @@ static Lisp_Object locate_file_find_directory_hash_table(Lisp_Object directory) following semantics: a) nil - no suffix, just search for file name intact - (semantically different from "empty suffix list", which - would be meaningless.) + (semantically different from "empty suffix list", which + would be meaningless.) b) list - list of suffixes to append to file name. Each of these - must be a string. + must be a string. c) string - colon-separated suffixes to append to file name (backward - compatibility). + compatibility). All of this got hairy, so I decided to use a mapper. Calling a function for each suffix shouldn't slow things down, since @@ -1634,7 +1634,7 @@ they default to 0 and (length STRING) respectively. static Lisp_Object ureader_find(Lisp_Object name) { - return Fcdr(Fassoc(name, Vureaders)); + return Fcdr(Fassoc(name, Vureaders)); } /* @@ -1645,23 +1645,23 @@ ureader_find(Lisp_Object name) static Lisp_Object ureader_read(Lisp_Object ureader_fun, Lisp_Object readcharfun) { - Emchar c; - unsigned int oparens = 0; - struct gcpro gcpro1; - Lisp_Object instr; + Emchar c; + unsigned int oparens = 0; + struct gcpro gcpro1; + Lisp_Object instr; Lstream_rewind(XLSTREAM(Vread_buffer_stream)); while ((c = readchar(readcharfun)) >= 0) { - if (c == '<') - oparens++; - else if (c == '>') { - if (oparens == 0) - /* We got final closing paren */ - break; - else - oparens--; - } - Lstream_put_emchar(XLSTREAM (Vread_buffer_stream), c); + if (c == '<') + oparens++; + else if (c == '>') { + if (oparens == 0) + /* We got final closing paren */ + break; + else + oparens--; + } + Lstream_put_emchar(XLSTREAM (Vread_buffer_stream), c); QUIT; } if (c < 0) @@ -1669,12 +1669,12 @@ ureader_read(Lisp_Object ureader_fun, Lisp_Object readcharfun) list1(READCHARFUN_MAYBE(readcharfun))); Lstream_flush(XLSTREAM(Vread_buffer_stream)); - GCPRO1(instr); - instr = make_string(resizing_buffer_stream_ptr - (XLSTREAM(Vread_buffer_stream)), - Lstream_byte_count(XLSTREAM(Vread_buffer_stream))); + GCPRO1(instr); + instr = make_string(resizing_buffer_stream_ptr + (XLSTREAM(Vread_buffer_stream)), + Lstream_byte_count(XLSTREAM(Vread_buffer_stream))); - RETURN_UNGCPRO(call1(ureader_fun, instr)); + RETURN_UNGCPRO(call1(ureader_fun, instr)); } @@ -1977,7 +1977,7 @@ read_atom(Lisp_Object readcharfun, Emchar firstchar, int uninterned_symbol) return read_bigfr_string(read_ptr); #endif /* HAVE_MPFR */ #if defined HAVE_MPF && defined WITH_GMP - if (isfloat_string(read_ptr) && (Vread_real_as == Qbigf)) + if (isfloat_string(read_ptr) && (Vread_real_as == Qbigf)) return read_bigf_string(read_ptr); #endif /* HAVE_MPF */ @@ -2665,7 +2665,7 @@ retry: Emchar _c_ = reader_nextchar(readcharfun); /* check for permutation syntax */ if (_c_ == '[') { - Lisp_Object perm = + Lisp_Object perm = read_vector(readcharfun, ']'); if (ase_permutation_f) { return ase_permutation_f(perm); @@ -2690,11 +2690,11 @@ retry: * structure syntax */ return read_structure(readcharfun); case '<': { - /* Check user readers */ - Lisp_Object uoname = read_string(readcharfun, ' ', 0); - Lisp_Object ureader = ureader_find(uoname); - if (!NILP(ureader)) - return ureader_read(ureader, readcharfun); + /* Check user readers */ + Lisp_Object uoname = read_string(readcharfun, ' ', 0); + Lisp_Object ureader = ureader_find(uoname); + if (!NILP(ureader)) + return ureader_read(ureader, readcharfun); unreadchar(readcharfun, c); return Fsignal(Qinvalid_read_syntax, @@ -3081,7 +3081,7 @@ isbigq_string (const char *cp) /* Possible minus/plus sign */ if (*cp == '-' || *cp == '+') cp++; - + /* Numerator */ if (*cp < '0' || *cp > '9') return 0; @@ -3089,11 +3089,11 @@ isbigq_string (const char *cp) do { cp++; } while (*cp >= '0' && *cp <= '9'); - + /* Slash */ if (*cp++ != '/') return 0; - + /* Denominator */ if (*cp < '0' || *cp > '9') return 0; @@ -3161,7 +3161,7 @@ read_list_conser(Lisp_Object readcharfun, void *state, Charcount len) tem = Qnil; ch = XCHAR(elt); #ifdef FEATUREP_SYNTAX - if (ch == s->terminator) { + if (ch == s->terminator) { /* deal with #+, #- reader macros */ unreadchar(readcharfun, s->terminator); goto done; @@ -3688,15 +3688,15 @@ character escape syntaxes or just read them incorrectly. } #endif - /* User defined readers */ - DEFVAR_LISP("ureaders", &Vureaders /* + /* User defined readers */ + DEFVAR_LISP("ureaders", &Vureaders /* Alist of user defined readers. Car is ureader NAME, represented by string to match against when reading -# +# Cdr is user function called with one arg - string. Function must return lisp object or signal error. - */ - ); + */ + ); } /* lread.c ends here */ diff --git a/src/lrecord.h b/src/lrecord.h index b909267..0642434 100644 --- a/src/lrecord.h +++ b/src/lrecord.h @@ -681,7 +681,7 @@ error_check_##c_name (Lisp_Object obj) \ } \ extern Lisp_Object Q##c_name##p -# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ +# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ extern unsigned int lrecord_type_##c_name; \ extern struct lrecord_implementation lrecord_##c_name; \ extern_inline structtype * \ diff --git a/src/lstream.c b/src/lstream.c index eb7196d..21214e0 100644 --- a/src/lstream.c +++ b/src/lstream.c @@ -102,13 +102,13 @@ void Lstream_fungetc (Lstream *stream, int c) Function equivalents of the above macros. Lstream_data_count Lstream_read (Lstream *stream, void *data, - Lstream_data_count size) + Lstream_data_count size) Read SIZE bytes of DATA from the stream. Return the number of bytes read. 0 means EOF. -1 means an error occurred and no bytes were read. Lstream_data_count Lstream_write (Lstream *stream, void *data, - Lstream_data_count size) + Lstream_data_count size) Write SIZE bytes of DATA to the stream. Return the number of bytes written. -1 means an error occurred and no bytes were written. @@ -983,7 +983,7 @@ make_filedesc_stream_1(int filedesc, int offset, int count, int flags, const char *mode) { Lisp_Object obj = Qnil; - if (filedesc < 0) + if (filedesc < 0) return obj; lstream_t lstr = Lstream_new(lstream_filedesc, mode); filedesc_stream_t fstr = FILEDESC_STREAM_DATA(lstr); diff --git a/src/lstream.h b/src/lstream.h index 72f0718..a34e12b 100644 --- a/src/lstream.h +++ b/src/lstream.h @@ -53,7 +53,7 @@ DECLARE_LRECORD(lstream, struct lstream_s); functions. This MUST BE SIGNED, since it also is used in functions that return the number of bytes actually read to or written from in an operation, and these functions can return -1 to signal error. - + Note that the standard Unix read() and write() functions define the count going in as a size_t, which is UNSIGNED, and the count going out as an ssize_t, which is SIGNED. This is a horrible design -- 2.34.1