Author: paultcochrane
Date: Sat Mar 31 15:05:46 2007
New Revision: 17908

Modified:
   trunk/src/pmc/bigint.pmc
   trunk/src/pmc/complex.pmc
   trunk/src/pmc/default.pmc
   trunk/src/pmc/delegate.pmc
   trunk/src/pmc/fixedbooleanarray.pmc
   trunk/src/pmc/fixedpmcarray.pmc
   trunk/src/pmc/hash.pmc
   trunk/src/pmc/iterator.pmc
   trunk/src/pmc/key.pmc
   trunk/src/pmc/nci.pmc
   trunk/src/pmc/null.pmc
   trunk/src/pmc/parrotlibrary.pmc
   trunk/src/pmc/pccmethod_test.pmc
   trunk/src/pmc/resizablebooleanarray.pmc
   trunk/src/pmc/scalar.pmc
   trunk/src/pmc/smop_attribute.pmc
   trunk/src/pmc/stmvar.pmc
   trunk/src/pmc/string.pmc

Log:
[src/pmc] Correcting parenthesis-space issues as per coding standards (part 1)


Modified: trunk/src/pmc/bigint.pmc
==============================================================================
--- trunk/src/pmc/bigint.pmc    (original)
+++ trunk/src/pmc/bigint.pmc    Sat Mar 31 15:05:46 2007
@@ -102,7 +102,7 @@
 
 static double
 bigint_get_double(Interp *interp, PMC *self) {
-    return mpz_get_d( BN(self));
+    return mpz_get_d(BN(self));
 }
 
 static void

Modified: trunk/src/pmc/complex.pmc
==============================================================================
--- trunk/src/pmc/complex.pmc   (original)
+++ trunk/src/pmc/complex.pmc   Sat Mar 31 15:05:46 2007
@@ -81,7 +81,7 @@
         /* end of string; we only have a real part */
         second_num_length = 0;
     }
-    else if ( (*t == 'i' || *t == 'j') && *(t+1) == 0 ) {
+    else if ((*t == 'i' || *t == 'j') && *(t+1) == 0) {
         /* there is only an imaginary part, so the first number was
             actually the imaginary part */
         second_num_length = first_num_length;
@@ -115,7 +115,7 @@
             if (*t == ' ') t++; /* allow for one more optional space */
 
             /* verify that the string ends properly */
-            if ( (*t != 'i' && *t != 'j') || (*(t+1) != 0) ) {
+            if ((*t != 'i' && *t != 'j') || (*(t+1) != 0)) {
                 /* imaginary part does not end in 'i' or 'j' */
                 real_exception(interp, NULL, E_ValueError,
                     "Complex: malformed string");
@@ -1042,8 +1042,7 @@
 MMD_Complex: {
             return (INTVAL)(
                     RE(SELF) == RE(value) &&
-                    IM(SELF) == IM(value)
-                );
+                    IM(SELF) == IM(value));
         }
 MMD_DEFAULT: {
             if (IM(SELF) != 0.0)

Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc   (original)
+++ trunk/src/pmc/default.pmc   Sat Mar 31 15:05:46 2007
@@ -181,8 +181,7 @@
 check_get_std_props(Interp *interp, PMC *self, STRING *key) {
     if ((self->vtable->flags & (VTABLE_IS_CONST_FLAG | 
VTABLE_IS_READONLY_FLAG))
         &&!string_compare(interp, key,
-                          string_from_cstring(interp, "_ro", 3))
-        ) {
+                          string_from_cstring(interp, "_ro", 3))) {
         PMC *ret_val;
         ret_val = pmc_new(interp, enum_class_Integer);
         PMC_int_val(ret_val) = 1;

Modified: trunk/src/pmc/delegate.pmc
==============================================================================
--- trunk/src/pmc/delegate.pmc  (original)
+++ trunk/src/pmc/delegate.pmc  Sat Mar 31 15:05:46 2007
@@ -72,14 +72,12 @@
                 string_to_cstring(interp, meth),
                 string_to_cstring(interp, PMC_str_val(
                         get_attrib_num((SLOTTYPE *)PMC_data(class),
-                            PCD_CLASS_NAME)))
-                );
+                            PCD_CLASS_NAME))));
         }
         else {
             real_exception(interp, NULL, E_LookupError,
                 "Can't find method '%s' - erroneous PMC",
-                string_to_cstring(interp, meth)
-                );
+                string_to_cstring(interp, meth));
         }
     }
     return returnPMC;

Modified: trunk/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- trunk/src/pmc/fixedbooleanarray.pmc (original)
+++ trunk/src/pmc/fixedbooleanarray.pmc Sat Mar 31 15:05:46 2007
@@ -188,7 +188,7 @@
             real_exception(INTERP, NULL, E_IndexError,
                 "FixedBooleanArray: index out of bounds!");
 
-        return (sd[key/BITS_PER_CHAR] & ( 1 << ( key % BITS_PER_CHAR ))) ? 1:0;
+        return (sd[key/BITS_PER_CHAR] & (1 << (key % BITS_PER_CHAR))) ? 1:0;
     }
 
 /*
@@ -338,11 +338,11 @@
             real_exception(INTERP, NULL, E_IndexError,
                 "FixedBooleanArray: index out of bounds!");
 
-        if ( value ) {
-            sd[key/BITS_PER_CHAR] |= ( 1 << ( key % BITS_PER_CHAR ) );
+        if (value) {
+            sd[key/BITS_PER_CHAR] |= (1 << (key % BITS_PER_CHAR));
         }
         else {
-            sd[key/BITS_PER_CHAR] &= ( ~ ( 1 << ( key % BITS_PER_CHAR ) ) );
+            sd[key/BITS_PER_CHAR] &= (~ (1 << (key % BITS_PER_CHAR)));
         }
     }
 
@@ -373,7 +373,7 @@
 */
 
     void set_number_keyed_int(INTVAL key, FLOATVAL value) {
-        DYNSELF.set_integer_keyed_int(key, ( value ? 1 : 0 ));
+        DYNSELF.set_integer_keyed_int(key, (value ? 1 : 0));
     }
 
 /*

Modified: trunk/src/pmc/fixedpmcarray.pmc
==============================================================================
--- trunk/src/pmc/fixedpmcarray.pmc     (original)
+++ trunk/src/pmc/fixedpmcarray.pmc     Sat Mar 31 15:05:46 2007
@@ -55,7 +55,7 @@
 
     while (n > 1) {
         swap(&data[0], &data[n/2]);
-        for (i = 0, j = n; ; ) {
+        for (i = 0, j = n; ;) {
             do
                 --j;
             while (COMPARE(interp, data[j], data[0], cmp) > 0);

Modified: trunk/src/pmc/hash.pmc
==============================================================================
--- trunk/src/pmc/hash.pmc      (original)
+++ trunk/src/pmc/hash.pmc      Sat Mar 31 15:05:46 2007
@@ -34,10 +34,10 @@
 
 */
 
-static PMC* get_integer_pmc(Interp *interp, INTVAL base_type ) {
+static PMC* get_integer_pmc(Interp *interp, INTVAL base_type) {
 
     return pmc_new(interp,
-                   Parrot_get_ctx_HLL_type(interp, enum_class_Integer) );
+                   Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
 }
 
 
@@ -53,10 +53,10 @@
 
 */
 
-static PMC * get_number_pmc(Interp *interp, INTVAL base_type ) {
+static PMC * get_number_pmc(Interp *interp, INTVAL base_type) {
 
     return pmc_new(interp,
-                   Parrot_get_ctx_HLL_type(interp, enum_class_Float) );
+                   Parrot_get_ctx_HLL_type(interp, enum_class_Float));
 }
 
 /*
@@ -71,10 +71,10 @@
 
 */
 
-static PMC * get_string_pmc(Interp *interp, INTVAL base_type ) {
+static PMC * get_string_pmc(Interp *interp, INTVAL base_type) {
 
     return pmc_new(interp,
-                   Parrot_get_ctx_HLL_type(interp, enum_class_String) );
+                   Parrot_get_ctx_HLL_type(interp, enum_class_String));
 }
 
 
@@ -604,7 +604,7 @@
 */
 
     INTVAL is_same(PMC* other) {
-        return (INTVAL)( other->vtable == SELF->vtable &&
+        return (INTVAL)(other->vtable == SELF->vtable &&
             PMC_struct_val(other) == PMC_struct_val(SELF));
     }
 
@@ -902,7 +902,7 @@
         if (key == NULL)
             return VTABLE_defined(INTERP, (PMC*)b->value);
         else
-            return VTABLE_defined_keyed( INTERP, (PMC*)b->value, key);
+            return VTABLE_defined_keyed(INTERP, (PMC*)b->value, key);
     }
 
 /*

Modified: trunk/src/pmc/iterator.pmc
==============================================================================
--- trunk/src/pmc/iterator.pmc  (original)
+++ trunk/src/pmc/iterator.pmc  Sat Mar 31 15:05:46 2007
@@ -169,7 +169,7 @@
 */
 
     FLOATVAL get_number_keyed(PMC* key) {
-        return VTABLE_get_number_keyed(INTERP,(PMC *)PMC_pmc_val(SELF), key );
+        return VTABLE_get_number_keyed(INTERP,(PMC *)PMC_pmc_val(SELF), key);
     }
 
 /*
@@ -274,7 +274,7 @@
     PMC* get_pmc_keyed_int(INTVAL idx) {
         PMC * const key = PMC_struct_val(SELF);
         PMC * const agg = PMC_pmc_val(SELF);
-        return VTABLE_get_pmc_keyed_int(INTERP, agg, PMC_int_val(key) + idx );
+        return VTABLE_get_pmc_keyed_int(INTERP, agg, PMC_int_val(key) + idx);
     }
 
 /*
@@ -542,7 +542,7 @@
     INTVAL exists_keyed_int(INTVAL idx) {
         PMC * const key = PMC_struct_val(SELF);
         PMC * const agg = PMC_pmc_val(SELF);
-        return VTABLE_exists_keyed_int(INTERP, agg, PMC_int_val(key) + idx );
+        return VTABLE_exists_keyed_int(INTERP, agg, PMC_int_val(key) + idx);
     }
 
 /*
@@ -584,7 +584,7 @@
     INTVAL defined_keyed_int(INTVAL idx) {
         PMC * const key = PMC_struct_val(SELF);
         PMC * const agg = PMC_pmc_val(SELF);
-        return VTABLE_defined_keyed_int(INTERP, agg, PMC_int_val(key) + idx );
+        return VTABLE_defined_keyed_int(INTERP, agg, PMC_int_val(key) + idx);
     }
 
 /*
@@ -614,7 +614,7 @@
     INTVAL type_keyed_int(INTVAL idx) {
         PMC * const key = PMC_struct_val(SELF);
         PMC * const agg = PMC_pmc_val(SELF);
-        return VTABLE_type_keyed_int(INTERP, agg, PMC_int_val(key) + idx );
+        return VTABLE_type_keyed_int(INTERP, agg, PMC_int_val(key) + idx);
     }
 
     PMC* get_iter() {

Modified: trunk/src/pmc/key.pmc
==============================================================================
--- trunk/src/pmc/key.pmc       (original)
+++ trunk/src/pmc/key.pmc       Sat Mar 31 15:05:46 2007
@@ -24,7 +24,7 @@
 is_hash_iter(PMC *agg, PMC *key)
 {
     if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) ==
-        KEY_hash_iterator_FLAGS )
+        KEY_hash_iterator_FLAGS)
         return 1;
     return 0;
 }
@@ -62,7 +62,7 @@
         PMC *p;
 
         PObj_custom_mark_SET(dest);
-        for (; key ; ) {
+        for (; key ;) {
             switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
                 case KEY_integer_FLAG:
                 case KEY_integer_FLAG|KEY_register_FLAG:

Modified: trunk/src/pmc/nci.pmc
==============================================================================
--- trunk/src/pmc/nci.pmc       (original)
+++ trunk/src/pmc/nci.pmc       Sat Mar 31 15:05:46 2007
@@ -151,7 +151,7 @@
 */
 
     opcode_t* invoke(void * next) {
-        typedef INTVAL(*nci_sub_t)(Interp * , PMC * );
+        typedef INTVAL(*nci_sub_t)(Interp * , PMC *);
         nci_sub_t func = PObj_flag_TEST(private2, SELF)
             ? (nci_sub_t) PMC_struct_val(SELF)
             : (nci_sub_t) D2FPTR(PMC_data(SELF));

Modified: trunk/src/pmc/null.pmc
==============================================================================
--- trunk/src/pmc/null.pmc      (original)
+++ trunk/src/pmc/null.pmc      Sat Mar 31 15:05:46 2007
@@ -24,7 +24,7 @@
 static void
 show_backtrace(int ret, void *interp)
 {
-    PDB_backtrace( (Interp*)interp );
+    PDB_backtrace((Interp*)interp);
 }
 
 pmclass Null singleton {

Modified: trunk/src/pmc/parrotlibrary.pmc
==============================================================================
--- trunk/src/pmc/parrotlibrary.pmc     (original)
+++ trunk/src/pmc/parrotlibrary.pmc     Sat Mar 31 15:05:46 2007
@@ -95,7 +95,7 @@
 */
 
     INTVAL get_bool() {
-        return ( PMC_data(SELF) != NULL );
+        return (PMC_data(SELF) != NULL);
     }
 
 /*

Modified: trunk/src/pmc/pccmethod_test.pmc
==============================================================================
--- trunk/src/pmc/pccmethod_test.pmc    (original)
+++ trunk/src/pmc/pccmethod_test.pmc    Sat Mar 31 15:05:46 2007
@@ -50,17 +50,17 @@
     {
         PIO_printf(interp, "test_method\n");
     }
-    PCCMETHOD void test_method0( int a1 )
+    PCCMETHOD void test_method0(int a1)
     {
         PIO_printf(interp, "test_method0\n");
         PIO_printf(interp, "%d\n", a1);
     }
-    PCCMETHOD void test_method1( int a1, int a2, int a3, int a4, int a5, int 
a6)
+    PCCMETHOD void test_method1(int a1, int a2, int a3, int a4, int a5, int a6)
     {
         PIO_printf(interp, "test_method1\n");
         PIO_printf(interp, "%d,%d,%d,%d,%d,%d\n", a1, a2, a3, a4, a5, a6);
     }
-    PCCMETHOD void test_method2( int a1 :optional, int a1o :opt_flag, PMC 
*slurpy_pos :slurpy)
+    PCCMETHOD void test_method2(int a1 :optional, int a1o :opt_flag, PMC 
*slurpy_pos :slurpy)
     {
         STRING* kevin = string_from_cstring(interp, "KEVIN", 0);
         PIO_printf(interp, "test_method2\n");
@@ -74,8 +74,8 @@
         PIO_printf(interp, "test_method3\n");
         PIO_printf(interp, "%Ps, %Ps\n", a1, a2);
     }
-    PCCMETHOD void test_method4( int george :optional, int g_f :opt_flag, PMC 
*slurpy_pos :slurpy,
-            PMC *slurpy_named :slurpy :named )
+    PCCMETHOD void test_method4(int george :optional, int g_f :opt_flag, PMC 
*slurpy_pos :slurpy,
+            PMC *slurpy_named :slurpy :named)
     {
         PIO_printf(interp, "test_method4\n");
     }

Modified: trunk/src/pmc/resizablebooleanarray.pmc
==============================================================================
--- trunk/src/pmc/resizablebooleanarray.pmc     (original)
+++ trunk/src/pmc/resizablebooleanarray.pmc     Sat Mar 31 15:05:46 2007
@@ -121,7 +121,7 @@
         newASize = (size / MIN_ALLOC + 1) * MIN_ALLOC;
 
         /* Nothing allocated yet */
-        if ( ! PMC_data(SELF) ) {
+        if (! PMC_data(SELF)) {
             PMC_data(SELF) = mem_sys_allocate_zeroed(newASize);
         }
         else {
@@ -191,8 +191,7 @@
             Parrot_UInt1 * const sdNew = mem_sys_allocate_zeroed(
                 ((PMC_int_val2(SELF) / MIN_ALLOC) * MIN_ALLOC)
                 + PMC_int_val(SELF)
-                + ((PMC_int_val(SELF) / MIN_ALLOC + 1) * MIN_ALLOC)
-            );
+                + ((PMC_int_val(SELF) / MIN_ALLOC + 1) * MIN_ALLOC));
             mem_sys_memmove(sdNew, sdOld + PMC_int_val2(SELF),
                 PMC_int_val(SELF));
             mem_sys_free(sdOld);
@@ -238,8 +237,7 @@
             Parrot_UInt1 * const sdNew = mem_sys_allocate_zeroed(
                 ((PMC_int_val2(SELF) / MIN_ALLOC) * MIN_ALLOC)
                 + PMC_int_val(SELF)
-                + ((PMC_int_val(SELF) / MIN_ALLOC + 1) * MIN_ALLOC)
-            );
+                + ((PMC_int_val(SELF) / MIN_ALLOC + 1) * MIN_ALLOC));
             mem_sys_memmove(sdNew, sdOld + PMC_int_val2(SELF),
                 PMC_int_val(SELF));
             mem_sys_free(sdOld);

Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc    (original)
+++ trunk/src/pmc/scalar.pmc    Sat Mar 31 15:05:46 2007
@@ -1168,7 +1168,7 @@
 
     void i_concatenate_str(STRING* value) {
         STRING* s = DYNSELF.get_string();
-        DYNSELF.set_string_native( string_append(INTERP, s, value));
+        DYNSELF.set_string_native(string_append(INTERP, s, value));
     }
 
 /*

Modified: trunk/src/pmc/smop_attribute.pmc
==============================================================================
--- trunk/src/pmc/smop_attribute.pmc    (original)
+++ trunk/src/pmc/smop_attribute.pmc    Sat Mar 31 15:05:46 2007
@@ -90,11 +90,11 @@
 */
     PCCMETHOD void name(PMC *name :optional, int got_name :opt_flag) {
         STRING *name_attr = NULL;
-        if ( got_name ) {
+        if (got_name) {
             SMOP_attr(SELF)->name = VTABLE_get_string(interp, name);
         }
         name_attr = SMOP_attr(SELF)->name;
-        PCCRETURN( STRING *name_attr );
+        PCCRETURN(STRING *name_attr);
     }
 /*
 
@@ -107,11 +107,11 @@
 */
     PCCMETHOD void class(PMC *class :optional, int got_class :opt_flag) {
         PMC *class_attr = NULL;
-        if ( got_class ) {
+        if (got_class) {
             SMOP_attr(SELF)->class_ = class;
         }
         class_attr = SMOP_attr(SELF)->class_;
-        PCCRETURN( PMC *class_attr );
+        PCCRETURN(PMC *class_attr);
     }
 /*
 
@@ -124,11 +124,11 @@
 */
     PCCMETHOD void type(PMC *type :optional, int got_type :opt_flag) {
         STRING *type_string = NULL;
-        if ( got_type ) {
+        if (got_type) {
             SMOP_attr(SELF)->type_ = VTABLE_get_string(interp, type);
         }
         type_string = SMOP_attr(SELF)->type_;
-        PCCRETURN( STRING *type_string );
+        PCCRETURN(STRING *type_string);
     }
 }
 

Modified: trunk/src/pmc/stmvar.pmc
==============================================================================
--- trunk/src/pmc/stmvar.pmc    (original)
+++ trunk/src/pmc/stmvar.pmc    Sat Mar 31 15:05:46 2007
@@ -47,7 +47,7 @@
 
     void init_pmc(PMC* value) {
         PMC_struct_val(SELF) = NULL;
-        if (   value->vtable->base_type == enum_class_STMRef
+        if (value->vtable->base_type == enum_class_STMRef
             || value->vtable->base_type == enum_class_STMVar) {
             PMC_struct_val(SELF) = PMC_struct_val(value);
         }

Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc    (original)
+++ trunk/src/pmc/string.pmc    Sat Mar 31 15:05:46 2007
@@ -183,11 +183,11 @@
 */
 
     void set_integer_native(INTVAL value) {
-        DYNSELF.set_string_native( string_from_int(INTERP, value) );
+        DYNSELF.set_string_native(string_from_int(INTERP, value));
     }
 
     void set_bool(INTVAL value) {
-        DYNSELF.set_string_native( string_from_int(INTERP, value) );
+        DYNSELF.set_string_native(string_from_int(INTERP, value));
     }
 
 /*
@@ -201,7 +201,7 @@
 */
 
     void set_number_native(FLOATVAL value) {
-        DYNSELF.set_string_native( string_from_num(INTERP, value) );
+        DYNSELF.set_string_native(string_from_num(INTERP, value));
     }
 
 
@@ -261,7 +261,7 @@
 
 */
     void set_pmc(PMC* value) {
-        DYNSELF.set_string_native( VTABLE_get_string(INTERP, value) );
+        DYNSELF.set_string_native(VTABLE_get_string(INTERP, value));
     }
 
 /*
@@ -476,8 +476,7 @@
         STRING *v = VTABLE_get_string(INTERP, value);
         return (INTVAL)(
                 value->vtable == SELF->vtable &&
-                s == v
-            );
+                s == v);
     }
 
 /*
@@ -580,7 +579,7 @@
     INTVAL exists_keyed(PMC* key) {
         INTVAL n = string_length(INTERP, VTABLE_get_string(INTERP, SELF));
         INTVAL k = VTABLE_get_integer(INTERP, key);
-        return (INTVAL)( (k>=0 && k<=n) || (k<0 && -k<=n) );
+        return (INTVAL)((k>=0 && k<=n) || (k<0 && -k<=n));
     }
 
 /*
@@ -799,7 +798,7 @@
         IMAGE_IO *io = info->image_io;
         SUPER(info);
         if (info->extra_flags == EXTRA_IS_NULL)
-            DYNSELF.set_string_native( io->vtable->shift_string(INTERP, io) );
+            DYNSELF.set_string_native(io->vtable->shift_string(INTERP, io));
     }
 /*
 

Reply via email to