[gjs] fix indentation, tabs, and trailing whitespace



commit 941791d4cbcf4a42ecac63d47ab2333613d847b8
Author: Havoc Pennington <hp pobox com>
Date:   Fri Apr 30 21:49:09 2010 -0400

    fix indentation, tabs, and trailing whitespace
    
    As reported by:
    
    FILES=`find -name "*.[hc]" -o -name "*.js" | grep -v -- '-introspection.c'`
    
    for F in $FILES ; do
        COUNT=`egrep '[ ]+$' $F | wc -l`
        if test x"$COUNT" != x0 ; then
            echo "$F: $COUNT trailing spaces"
        fi
        COUNT=`grep '       ' $F | wc -l`
        if test x"$COUNT" != x0 ; then
            echo "$F: $COUNT tabs"
        fi
    done

 gi/arg.c                              |    2 +-
 gi/boxed.c                            |   46 +++++-----
 gi/object.c                           |   14 ++--
 gjs-dbus/dbus-proxy.c                 |    2 +-
 gjs/console.c                         |    2 +-
 gjs/context.c                         |    6 +-
 gjs/jsapi-util-error.c                |    4 +-
 gjs/jsapi-util-string.c               |   10 +-
 gjs/jsapi-util.c                      |  176 ++++++++++++++++----------------
 gjs/stack.c                           |   22 ++--
 modules/console.c                     |    8 +-
 modules/dbus-values.c                 |   10 +-
 modules/dbus-values.h                 |    2 +-
 modules/gettext-native.c              |   24 +++---
 modules/gettext.js                    |   12 +-
 modules/mainloop.c                    |    4 +-
 modules/tweener/tweener.js            |   34 +++---
 test/js/testEverythingBasic.js        |   26 +++---
 test/js/testEverythingEncapsulated.js |   28 +++---
 test/js/testTweener.js                |   32 +++---
 20 files changed, 232 insertions(+), 232 deletions(-)
---
diff --git a/gi/arg.c b/gi/arg.c
index 2c23355..ba2e84f 100644
--- a/gi/arg.c
+++ b/gi/arg.c
@@ -45,7 +45,7 @@ _gjs_flags_value_is_valid(JSContext   *context,
     /* FIXME: Do proper value check for flags with GType's */
     if (gtype == G_TYPE_NONE)
         return JS_TRUE;
-    
+
     klass = g_type_class_ref(gtype);
 
     /* check all bits are defined for flags.. not necessarily desired */
diff --git a/gi/boxed.c b/gi/boxed.c
index d3bc4ec..11e2bad 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -1068,43 +1068,43 @@ struct_is_simple(GIStructInfo *info)
             case GI_TYPE_TAG_GHASH:
                 break;
             case GI_TYPE_TAG_INTERFACE:
-	    {
+            {
                 GIBaseInfo *interface = g_type_info_get_interface (type_info);
                 switch (g_base_info_get_type (interface)) {
-		case GI_INFO_TYPE_BOXED:
-		case GI_INFO_TYPE_STRUCT:
+                case GI_INFO_TYPE_BOXED:
+                case GI_INFO_TYPE_STRUCT:
                     if (!struct_is_simple ((GIStructInfo *)interface))
                         is_simple = FALSE;
                     break;
-		case GI_INFO_TYPE_UNION:
+                case GI_INFO_TYPE_UNION:
                     /* FIXME: Need to implement */
                     is_simple = FALSE;
                     break;
-		case GI_INFO_TYPE_ENUM:
-		case GI_INFO_TYPE_FLAGS:
+                case GI_INFO_TYPE_ENUM:
+                case GI_INFO_TYPE_FLAGS:
                     break;
-		case GI_INFO_TYPE_OBJECT:
-		case GI_INFO_TYPE_VFUNC:
-		case GI_INFO_TYPE_CALLBACK:
-		case GI_INFO_TYPE_INVALID:
-		case GI_INFO_TYPE_INTERFACE:
-		case GI_INFO_TYPE_FUNCTION:
-		case GI_INFO_TYPE_CONSTANT:
-		case GI_INFO_TYPE_ERROR_DOMAIN:
-		case GI_INFO_TYPE_VALUE:
-		case GI_INFO_TYPE_SIGNAL:
-		case GI_INFO_TYPE_PROPERTY:
-		case GI_INFO_TYPE_FIELD:
-		case GI_INFO_TYPE_ARG:
-		case GI_INFO_TYPE_TYPE:
-		case GI_INFO_TYPE_UNRESOLVED:
+                case GI_INFO_TYPE_OBJECT:
+                case GI_INFO_TYPE_VFUNC:
+                case GI_INFO_TYPE_CALLBACK:
+                case GI_INFO_TYPE_INVALID:
+                case GI_INFO_TYPE_INTERFACE:
+                case GI_INFO_TYPE_FUNCTION:
+                case GI_INFO_TYPE_CONSTANT:
+                case GI_INFO_TYPE_ERROR_DOMAIN:
+                case GI_INFO_TYPE_VALUE:
+                case GI_INFO_TYPE_SIGNAL:
+                case GI_INFO_TYPE_PROPERTY:
+                case GI_INFO_TYPE_FIELD:
+                case GI_INFO_TYPE_ARG:
+                case GI_INFO_TYPE_TYPE:
+                case GI_INFO_TYPE_UNRESOLVED:
                     is_simple = FALSE;
                     break;
-		}
+                }
 
                 g_base_info_unref (interface);
                 break;
-	    }
+            }
             }
         }
 
diff --git a/gi/object.c b/gi/object.c
index 4d73fac..7114819 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1098,23 +1098,23 @@ to_string_func(JSContext *context,
     JSBool ret;
     const char *namespace;
     const char *name;
-    
+
     *retval = JSVAL_VOID;
 
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
         return JS_FALSE; /* wrong class passed in */
-    
+
     namespace = g_base_info_get_namespace( (GIBaseInfo*) priv->info);
-    name = g_base_info_get_name( (GIBaseInfo*) priv->info); 
+    name = g_base_info_get_name( (GIBaseInfo*) priv->info);
 
     if (priv->gobj == NULL) {
         strval = g_strdup_printf ("[object prototype of GIName:%s.%s jsobj %p]", namespace, name, obj);
     } else {
         strval = g_strdup_printf ("[object instance proxy GIName:%s.%s jsobj %p native %p]", namespace, name, obj, priv->gobj);
     }
-    
+
     ret = gjs_string_from_utf8 (context, strval, -1, retval);
     g_free (strval);
     return ret;
@@ -1451,9 +1451,9 @@ get_obj_key(JSRuntime *runtime,
         buf[2] = '-';
         d.ptr = runtime;
         for (i = 0; i < sizeof(void*); i++) {
-        	int offset = OBJ_KEY_PREFIX_LEN+(i*2);
-        	buf[offset] = 'a' + ((d.bytes[i] & 0xf0) >> 4);
-        	buf[offset+1] = 'a' + (d.bytes[i] & 0x0f);
+                int offset = OBJ_KEY_PREFIX_LEN+(i*2);
+                buf[offset] = 'a' + ((d.bytes[i] & 0xf0) >> 4);
+                buf[offset+1] = 'a' + (d.bytes[i] & 0x0f);
         }
         buf[OBJ_KEY_LEN] = '\0';
         strcpy(cached_buf, buf);
diff --git a/gjs-dbus/dbus-proxy.c b/gjs-dbus/dbus-proxy.c
index ae3a355..b81c70e 100644
--- a/gjs-dbus/dbus-proxy.c
+++ b/gjs-dbus/dbus-proxy.c
@@ -577,7 +577,7 @@ gjs_dbus_proxy_send_internal(GjsDBusProxy              *proxy,
         return;
     }
 
-    gjs_debug(GJS_DEBUG_DBUS, 
+    gjs_debug(GJS_DEBUG_DBUS,
               "Sending dbus proxy call %s",
               dbus_message_get_member(message));
 
diff --git a/gjs/console.c b/gjs/console.c
index e9cf8f9..f00631b 100644
--- a/gjs/console.c
+++ b/gjs/console.c
@@ -105,7 +105,7 @@ main(int argc, char **argv)
         g_printerr("%s\n", error->message);
         exit(1);
     }
-    
+
     gjs_memory_report("before destroying context", FALSE);
     g_object_unref(js_context);
     gjs_memory_report("after destroying context", TRUE);
diff --git a/gjs/context.c b/gjs/context.c
index ded5b8d..035c8d3 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -386,7 +386,7 @@ gjs_context_finalize(GObject *object)
         g_strfreev(js_context->search_path);
         js_context->search_path = NULL;
     }
-    
+
     g_static_mutex_lock(&contexts_lock);
     all_contexts = g_list_remove(all_contexts, object);
     g_static_mutex_unlock(&contexts_lock);
@@ -723,11 +723,11 @@ gjs_context_new_with_search_path(char** search_path)
 
 /**
  * gjs_context_get_all:
- * 
+ *
  * Returns a newly-allocated list containing all known instances of #GjsContext.
  * This is useful for operating on the contexts from a process-global situation
  * such as a debugger.
- * 
+ *
  * Return value: (element-type GjsContext) (transfer full): Known #GjsContext instances
  */
 GList*
diff --git a/gjs/jsapi-util-error.c b/gjs/jsapi-util-error.c
index dd177c5..2b86718 100644
--- a/gjs/jsapi-util-error.c
+++ b/gjs/jsapi-util-error.c
@@ -161,7 +161,7 @@ gjs_throw(JSContext       *context,
 
 /**
  * gjs_throw_literal:
- * 
+ *
  * Similar to gjs_throw(), but does not treat its argument as
  * a format string.
  */
@@ -174,7 +174,7 @@ gjs_throw_literal(JSContext       *context,
 
 /**
  * gjs_throw_g_error:
- * 
+ *
  * Convert a GError into a JavaScript Exception, and
  * frees the GError.  Like gjs_throw(), will not overwrite
  * an already pending exception.
diff --git a/gjs/jsapi-util-string.c b/gjs/jsapi-util-string.c
index 475008c..fc669a0 100644
--- a/gjs/jsapi-util-string.c
+++ b/gjs/jsapi-util-string.c
@@ -96,7 +96,7 @@ gjs_string_to_utf8 (JSContext  *context,
                     char      **utf8_string_p)
 {
   GError *error = NULL;
-  
+
   if (!gjs_try_string_to_utf8(context, string_val, utf8_string_p, &error))
     {
       gjs_throw_g_error(context, error);
@@ -162,7 +162,7 @@ gjs_try_string_to_filename(JSContext    *context,
       /* exception already set */
       return JS_FALSE;
   }
-  
+
   error = NULL;
   filename_string = g_filename_from_utf8(tmp, -1, NULL, NULL, error);
   if (!filename_string) {
@@ -171,9 +171,9 @@ gjs_try_string_to_filename(JSContext    *context,
   }
 
   *filename_string_p = filename_string;
-  
+
   g_free(tmp);
-  return TRUE;  
+  return TRUE;
 }
 
 JSBool
@@ -215,7 +215,7 @@ gjs_string_from_filename(JSContext  *context,
         g_free(utf8_string);
         return JS_FALSE;
     }
-    
+
     if (!gjs_string_from_utf8(context, utf8_string, written, value_p))
         return JS_FALSE;
 
diff --git a/gjs/jsapi-util.c b/gjs/jsapi-util.c
index b40a4b3..25bdf5c 100644
--- a/gjs/jsapi-util.c
+++ b/gjs/jsapi-util.c
@@ -37,7 +37,7 @@
 GQuark
 gjs_util_error_quark (void)
 {
-  return g_quark_from_static_string ("gjs-util-error-quark");
+    return g_quark_from_static_string ("gjs-util-error-quark");
 }
 
 typedef struct {
@@ -83,9 +83,9 @@ gjs_runtime_get_load_context(JSRuntime *runtime)
                                "is-load-context", TRUE,
                                NULL);
         gjs_runtime_set_data(runtime,
-                                "gjs-load-context",
-                                context,
-                                g_object_unref);
+                             "gjs-load-context",
+                             context,
+                             g_object_unref);
     }
 
     return (JSContext*)gjs_context_get_native_context(context);
@@ -109,9 +109,9 @@ gjs_runtime_clear_load_context(JSRuntime *runtime)
 {
     gjs_debug(GJS_DEBUG_CONTEXT, "Clearing load context");
     gjs_runtime_set_data(runtime,
-                            "gjs-load-context",
-                            NULL,
-                            NULL);
+                         "gjs-load-context",
+                         NULL,
+                         NULL);
     gjs_debug(GJS_DEBUG_CONTEXT, "Load context cleared");
 }
 
@@ -139,9 +139,9 @@ gjs_runtime_get_call_context(JSRuntime *runtime)
                                "runtime", runtime,
                                NULL);
         gjs_runtime_set_data(runtime,
-                                "gjs-call-context",
-                                context,
-                                g_object_unref);
+                             "gjs-call-context",
+                             context,
+                             g_object_unref);
     }
 
     return (JSContext*)gjs_context_get_native_context(context);
@@ -165,9 +165,9 @@ gjs_runtime_clear_call_context(JSRuntime *runtime)
 {
     gjs_debug(GJS_DEBUG_CONTEXT, "Clearing call context");
     gjs_runtime_set_data(runtime,
-                            "gjs-call-context",
-                            NULL,
-                            NULL);
+                         "gjs-call-context",
+                         NULL,
+                         NULL);
     gjs_debug(GJS_DEBUG_CONTEXT, "Call context cleared");
 }
 
@@ -203,7 +203,7 @@ get_data_from_runtime(JSRuntime *runtime)
         rd = g_slice_new0(RuntimeData);
         rd->dynamic_classes = g_hash_table_new(g_direct_hash, g_direct_equal);
         gjs_runtime_set_data(runtime, "gjs-api-util-data",
-                                rd, runtime_data_destroy_notify);
+                             rd, runtime_data_destroy_notify);
     }
 
     return rd;
@@ -221,8 +221,8 @@ get_data_from_context(JSContext *context)
  */
 gboolean
 gjs_object_has_property(JSContext  *context,
-                           JSObject   *obj,
-                           const char *property_name)
+                        JSObject   *obj,
+                        const char *property_name)
 {
     return gjs_object_get_property(context, obj, property_name, NULL);
 }
@@ -235,9 +235,9 @@ gjs_object_has_property(JSContext  *context,
  */
 gboolean
 gjs_object_get_property(JSContext  *context,
-                           JSObject   *obj,
-                           const char *property_name,
-                           jsval      *value_p)
+                        JSObject   *obj,
+                        const char *property_name,
+                        jsval      *value_p)
 {
     jsval value;
     JSExceptionState *state;
@@ -336,14 +336,14 @@ gjs_init_class_dynamic(JSContext      *context,
 
     prototype = NULL;
     if (gjs_object_get_property(load_context, JS_GetGlobalObject(load_context),
-                                   private_name, &value) &&
+                                private_name, &value) &&
         JSVAL_IS_OBJECT(value)) {
         jsval proto_val;
 
         g_free(private_name); /* don't need it anymore */
 
         if (!gjs_object_require_property(load_context, JSVAL_TO_OBJECT(value), NULL,
-                                            "prototype", &proto_val) ||
+                                         "prototype", &proto_val) ||
             !JSVAL_IS_OBJECT(proto_val)) {
             gjs_throw(load_context, "prototype was not defined or not an object?");
             goto error;
@@ -381,7 +381,7 @@ gjs_init_class_dynamic(JSContext      *context,
          * in_object
          */
         if (!gjs_object_require_property(load_context, JS_GetGlobalObject(load_context), NULL,
-                                            class_copy->base.name, &value))
+                                         class_copy->base.name, &value))
             goto error;
     }
     g_assert(value != JSVAL_VOID);
@@ -445,8 +445,8 @@ gjs_get_instance_private_dynamic(JSContext      *context,
     /* Check that it's safe to cast to DynamicJSClass */
     if (g_hash_table_lookup(rd->dynamic_classes, obj_class) == NULL) {
         gjs_throw(context,
-                     "Object %p proto %p doesn't have a dynamically-registered class, it has %s",
-                     obj, JS_GetPrototype(context, obj), obj_class->name);
+                  "Object %p proto %p doesn't have a dynamically-registered class, it has %s",
+                  obj, JS_GetPrototype(context, obj), obj_class->name);
         return NULL;
     }
 
@@ -757,8 +757,8 @@ gjs_log_exception_props(JSContext *context,
         gjs_object_has_property(context, exc_obj, "message");
 
         gjs_log_object_props(context, exc_obj,
-                                GJS_DEBUG_ERROR,
-                                "  ");
+                             GJS_DEBUG_ERROR,
+                             "  ");
     } else if (JSVAL_IS_STRING(exc)) {
         gjs_debug(GJS_DEBUG_ERROR,
                   "Exception was a String");
@@ -1047,12 +1047,12 @@ gjs_date_from_time_t (JSContext *context, time_t time)
  * @Varargs: for each character in @format, a pair of a char * which is the name
  * of the argument, and a pointer to a location to store the value. The type of
  * value stored depends on the format character, as described below.
- * 
+ *
  * This function is inspired by Python's PyArg_ParseTuple for those
  * familiar with it.  It takes a format specifier which gives the
  * types of the expected arguments, and a list of argument names and
  * value location pairs.  The currently accepted format specifiers are:
- * 
+ *
  * s: A string, converted into UTF-8
  * z: Like 's', but may be null in JavaScript (which appears as NULL in C)
  * F: A string, converted into "filename encoding" (i.e. active locale)
@@ -1112,7 +1112,7 @@ gjs_parse_args (JSContext  *context,
      * @i: The current integer position in fmt_args
      * @fmt_iter: A pointer to the character in fmt_args
      * @consumed_args: How many arguments we've taken from argv
-     * 
+     *
      * consumed_args can currently be different from 'i' because of the '|' character.
      */
     for (i = 0, consumed_args = 0, fmt_iter = format; *fmt_iter; fmt_iter++, i++) {
@@ -1135,93 +1135,93 @@ gjs_parse_args (JSContext  *context,
         g_return_val_if_fail (arg_location != NULL, JS_FALSE);
 
         js_value = argv[consumed_args];
-        
+
         switch (*fmt_iter) {
-            case 'o': {
-               if (!JSVAL_IS_OBJECT(js_value)) {
-                   arg_error_message = "Not an object";
-               } else {
-                   JSObject **arg = arg_location;
-                   *arg = JSVAL_TO_OBJECT(js_value);
-               }
-            }
-            break;
-            case 's':
-            case 'z': {
-                char **arg = arg_location;
-                
-                if (*fmt_iter == 'z' && JSVAL_IS_NULL(js_value)) {
-                    *arg = NULL;
-                } else {
-                    if (gjs_try_string_to_utf8 (context, js_value, arg, &arg_error)) {
-                        unwind_strings[n_unwind++] = *arg;
-                        g_assert(n_unwind < MAX_UNWIND_STRINGS);
-                    }
-                }    
+        case 'o': {
+            if (!JSVAL_IS_OBJECT(js_value)) {
+                arg_error_message = "Not an object";
+            } else {
+                JSObject **arg = arg_location;
+                *arg = JSVAL_TO_OBJECT(js_value);
             }
+        }
             break;
-            case 'F': {
-                char **arg = arg_location;
-                
-                if (gjs_try_string_to_filename (context, js_value, arg, &arg_error)) {
+        case 's':
+        case 'z': {
+            char **arg = arg_location;
+
+            if (*fmt_iter == 'z' && JSVAL_IS_NULL(js_value)) {
+                *arg = NULL;
+            } else {
+                if (gjs_try_string_to_utf8 (context, js_value, arg, &arg_error)) {
                     unwind_strings[n_unwind++] = *arg;
                     g_assert(n_unwind < MAX_UNWIND_STRINGS);
                 }
             }
+        }
             break;
-            case 'i': {
-                if (!JS_ValueToInt32(context, js_value, (gint32*) arg_location)) {
-                    /* Our error message is going to be more useful */
-                    JS_ClearPendingException(context);
-                    arg_error_message = "Couldn't convert to integer";
-                }
+        case 'F': {
+            char **arg = arg_location;
+
+            if (gjs_try_string_to_filename (context, js_value, arg, &arg_error)) {
+                unwind_strings[n_unwind++] = *arg;
+                g_assert(n_unwind < MAX_UNWIND_STRINGS);
             }
+        }
             break;
-            case 'u': {
-                gdouble num;
-                if (!JS_ValueToNumber(context, js_value, &num)) {
-                    /* Our error message is going to be more useful */
-                    JS_ClearPendingException(context);
-                    arg_error_message = "Couldn't convert to unsigned integer";
-                } else if (num > G_MAXUINT32 || num < 0) {
-                    arg_error_message = "Value is out of range";
-                } else {
-                    *((guint32*) arg_location) = num;
-                }
+        case 'i': {
+            if (!JS_ValueToInt32(context, js_value, (gint32*) arg_location)) {
+                /* Our error message is going to be more useful */
+                JS_ClearPendingException(context);
+                arg_error_message = "Couldn't convert to integer";
             }
+        }
             break;
-            case 'f': {
-                double num;
-                if (!JS_ValueToNumber(context, js_value, &num)) {
-                    /* Our error message is going to be more useful */
-                    JS_ClearPendingException(context);
-                    arg_error_message = "Couldn't convert to double";
-                } else {
-                    *((double*) arg_location) = num;
-                }
+        case 'u': {
+            gdouble num;
+            if (!JS_ValueToNumber(context, js_value, &num)) {
+                /* Our error message is going to be more useful */
+                JS_ClearPendingException(context);
+                arg_error_message = "Couldn't convert to unsigned integer";
+            } else if (num > G_MAXUINT32 || num < 0) {
+                arg_error_message = "Value is out of range";
+            } else {
+                *((guint32*) arg_location) = num;
+            }
+        }
+            break;
+        case 'f': {
+            double num;
+            if (!JS_ValueToNumber(context, js_value, &num)) {
+                /* Our error message is going to be more useful */
+                JS_ClearPendingException(context);
+                arg_error_message = "Couldn't convert to double";
+            } else {
+                *((double*) arg_location) = num;
             }
+        }
             break;
-            default:
-              g_assert_not_reached ();
+        default:
+            g_assert_not_reached ();
         }
-        
+
         if (arg_error != NULL)
             arg_error_message = arg_error->message;
-        
+
         if (arg_error_message != NULL) {
-            gjs_throw(context, "Error invoking %s, at argument %d (%s): %s", function_name, 
+            gjs_throw(context, "Error invoking %s, at argument %d (%s): %s", function_name,
                       consumed_args+1, argname, arg_error_message);
             g_clear_error (&arg_error);
             goto error_unwind;
         }
-        
+
         consumed_args++;
     }
 
     va_end (args);
     return JS_TRUE;
 
-  error_unwind:
+ error_unwind:
     va_end (args);
     /* We still own the strings in the error case, free any we converted */
     for (i = 0; i < n_unwind; i++) {
diff --git a/gjs/stack.c b/gjs/stack.c
index cfdd6c7..410fc24 100644
--- a/gjs/stack.c
+++ b/gjs/stack.c
@@ -46,14 +46,14 @@
 #include <string.h>
 #include <jsdbgapi.h>
 
-static const char* 
+static const char*
 jsvalue_to_string(JSContext* cx, jsval val, gboolean* is_string)
 {
     const char* value = NULL;
     JSString* value_str;
-    
+
     JS_EnterLocalRootScope(cx);
-    
+
     value_str = JS_ValueToString(cx, val);
     if (value_str)
         value = JS_GetStringBytes(value_str);
@@ -65,14 +65,14 @@ jsvalue_to_string(JSContext* cx, jsval val, gboolean* is_string)
 
     if (is_string)
         *is_string = JSVAL_IS_STRING(val);
-    
+
     JS_LeaveLocalRootScope(cx);
-    
+
     return value;
 }
 
 
-static void 
+static void
 format_frame(JSContext* cx, JSStackFrame* fp,
              GString *buf, int num)
 {
@@ -91,7 +91,7 @@ format_frame(JSContext* cx, JSStackFrame* fp,
     jsval val;
 
     JS_EnterLocalRootScope(cx);
-    
+
     if (JS_IsNativeFrame(cx, fp)) {
         g_string_append_printf(buf, "%d [native frame]\n", num);
         goto out;
@@ -101,14 +101,14 @@ format_frame(JSContext* cx, JSStackFrame* fp,
 
     script = JS_GetFrameScript(cx, fp);
     pc = JS_GetFramePC(cx, fp);
-    
+
     if (script && pc) {
         filename = JS_GetScriptFilename(cx, script);
         lineno =  (guint32) JS_PCToLineNumber(cx, script, pc);
         fun = JS_GetFrameFunction(cx, fp);
         if (fun)
             funname = JS_GetFunctionName(fun);
-        
+
         call_obj = JS_GetFrameCallObject(cx, fp);
         if (call_obj) {
             if (!JS_GetPropertyDescArray(cx, call_obj, &call_props))
@@ -232,9 +232,9 @@ void
 gjstest_test_func_gjs_stack_dump(void)
 {
   GjsContext *context;
-  
+
   g_type_init();
-  
+
   /* TODO this test could be better - maybe expose dumpstack as a JS API
    * so that we have a JS stack to dump?  At least here we're getting some
    * coverage.
diff --git a/modules/console.c b/modules/console.c
index c19efba..7410ee5 100644
--- a/modules/console.c
+++ b/modules/console.c
@@ -67,7 +67,7 @@ gjs_console_error_reporter(JSContext *cx, const char *message, JSErrorReport *re
         fprintf(stderr, "%s\n", message);
         return;
     }
-    
+
     prefix = NULL;
     if (report->filename)
         prefix = g_strdup_printf("%s:", report->filename);
@@ -136,7 +136,7 @@ gjs_console_readline(JSContext *cx, char *bufp, FILE *file, const char *prompt)
         add_history(line);
     if (!line) {
         return JS_FALSE;
-    }        
+    }
     strcpy(bufp, line);
     free(line);
     return JS_TRUE;
@@ -153,7 +153,7 @@ gjs_console_readline(JSContext *cx, char *bufp, FILE *file, const char *prompt)
     strcpy(bufp, line);
     return JS_TRUE;
 }
-#endif    
+#endif
 
 JSBool
 gjs_console_interact(JSContext *context,
@@ -211,7 +211,7 @@ gjs_console_interact(JSContext *context,
         } else {
             str = JS_ValueToString(context, result);
         }
-        
+
         if (str)
             g_fprintf(stdout, "%s\n", JS_GetStringBytes(str));
 
diff --git a/modules/dbus-values.c b/modules/dbus-values.c
index 1ddbd79..1dae132 100644
--- a/modules/dbus-values.c
+++ b/modules/dbus-values.c
@@ -602,12 +602,12 @@ append_array(JSContext         *context,
         dbus_signature_iter_recurse(sig_iter, &element_sig_iter);
 
         dbus_message_iter_open_container(iter, DBUS_TYPE_STRUCT, NULL, &struct_iter);
-        
+
         have_next = dbus_signature_iter_get_current_type(&element_sig_iter) != DBUS_TYPE_INVALID;
 
         for (i = 0; i < length; i++) {
             element = JSVAL_VOID;
-            
+
             if (!have_next) {
                 gjs_throw(context, "Insufficient elements for structure in JS Array");
                 return JS_FALSE;
@@ -623,10 +623,10 @@ append_array(JSContext         *context,
             if (!gjs_js_one_value_to_dbus(context, element, &struct_iter,
                                           &element_sig_iter))
                 return JS_FALSE;
-            
+
             have_next = dbus_signature_iter_next (&element_sig_iter);
         }
-        
+
         if (have_next) {
             gjs_throw(context, "Too many elements for structure in JS Array");
             return JS_FALSE;
@@ -661,7 +661,7 @@ append_array(JSContext         *context,
         }
 
         dbus_message_iter_close_container(iter, &array_iter);
-        
+
         return JS_TRUE;
     } else {
       gjs_throw(context,
diff --git a/modules/dbus-values.h b/modules/dbus-values.h
index e9ff697..3def5bf 100644
--- a/modules/dbus-values.h
+++ b/modules/dbus-values.h
@@ -43,7 +43,7 @@ JSBool gjs_js_one_value_to_dbus   (JSContext          *context,
                                    jsval               value,
                                    DBusMessageIter    *iter,
                                    DBusSignatureIter  *sig_iter);
-                                            
+
 void gjs_js_set_current_message   (DBusMessage        *message);
 
 
diff --git a/modules/gettext-native.c b/modules/gettext-native.c
index e75f141..73f3550 100644
--- a/modules/gettext-native.c
+++ b/modules/gettext-native.c
@@ -41,7 +41,7 @@ gjs_textdomain(JSContext *context,
     if (!gjs_parse_args(context, "textdomain", "s", argc, argv,
                         "domain", &domain))
         return JS_FALSE;
-    
+
     textdomain(domain);
     g_free(domain);
 
@@ -57,7 +57,7 @@ gjs_bindtextdomain(JSContext *context,
 {
     char *domain;
     char *location;
-    
+
     if (!gjs_parse_args (context, "bindtextdomain", "sF", argc, argv,
                          "domain", &domain,
                          "location", &location))
@@ -81,7 +81,7 @@ gjs_gettext(JSContext *context,
     char *msgid;
     const char *translated;
     JSBool result;
-    
+
     if (!gjs_parse_args (context, "gettext", "s", argc, argv,
                          "msgid", &msgid))
       return JS_FALSE;
@@ -103,7 +103,7 @@ gjs_dgettext(JSContext *context,
     char *msgid;
     const char *translated;
     JSBool result;
-    
+
     if (!gjs_parse_args (context, "dgettext", "zs", argc, argv,
                          "domain", &domain, "msgid", &msgid))
       return JS_FALSE;
@@ -128,13 +128,13 @@ gjs_ngettext(JSContext *context,
     guint32 n;
     const char *translated;
     JSBool result;
-    
+
     if (!gjs_parse_args (context, "ngettext", "ssu", argc, argv,
                          "msgid1", &msgid1, "msgid2", &msgid2, "n", &n))
       return JS_FALSE;
- 
+
     translated = ngettext(msgid1, msgid2, n);
-    
+
     result = gjs_string_from_utf8(context, translated, -1, retval);
     g_free (msgid1);
     g_free (msgid2);
@@ -154,7 +154,7 @@ gjs_dngettext(JSContext *context,
     guint n;
     const char *translated;
     JSBool result;
-    
+
     if (!gjs_parse_args (context, "dngettext", "zssu", argc, argv,
                          "domain", &domain, "msgid1", &msgid1,
                          "msgid2", &msgid2, "n", &n))
@@ -180,14 +180,14 @@ gjs_pgettext(JSContext *context,
     char *msgid;
     const char *translated;
     JSBool result;
-    
+
     if (!gjs_parse_args (context, "pgettext", "ss", argc, argv,
                          "context", &src_context, "msgid", &msgid))
       return JS_FALSE;
 
     translated = g_dpgettext2(NULL, src_context, msgid);
     g_free (src_context);
- 
+
     result = gjs_string_from_utf8(context, translated, -1, retval);
     g_free (msgid);
     return result;
@@ -205,7 +205,7 @@ gjs_dpgettext(JSContext *context,
     char *msgid;
     const char *translated;
     JSBool result;
-  
+
     if (!gjs_parse_args (context, "dpgettext", "sss", argc, argv,
                          "domain", &domain, "context", &src_context,
                          "msgid", &msgid))
@@ -235,7 +235,7 @@ gjs_define_gettext_stuff(JSContext      *context,
                            gjs_bindtextdomain,
                            2, GJS_MODULE_PROP_FLAGS))
         return JS_FALSE;
-  
+
     if (!JS_DefineFunction(context, module_obj,
                            "gettext",
                            gjs_gettext,
diff --git a/modules/gettext.js b/modules/gettext.js
index f569388..60f7212 100644
--- a/modules/gettext.js
+++ b/modules/gettext.js
@@ -21,12 +21,12 @@
 /**
  * This module provides bindings for the "gettext" family of functions.
  * Usage:
- * 
+ *
  * const Gettext = imports.gettext;
- * 
+ *
  * Gettext.textdomain("myapp");
  * Gettext.bindtextdomain("myapp", "/usr/share/locale");
- * 
+ *
  * let translated = Gettext.gettext("Hello world!");
  */
 
@@ -38,7 +38,7 @@ Lang.copyProperties(imports.gettextNative, this);
 /**
  * Create an object with bindings for gettext, ngettext,
  * and pgettext bound to a particular translation domain.
- * 
+ *
  * @param domainName Translation domain string
  * @returns: an object with gettext bindings
  * @type: function
@@ -48,11 +48,11 @@ var domain = function(domainName) {
         gettext: function(msgid) {
             return dgettext(domainName, msgid);
         },
-    
+
         ngettext: function(msgid1, msgid2, n) {
             return dngettext(domainName, msgid1, msgid2, n);
         },
-    
+
         pgettext: function(context, msgid) {
             return dpgettext(domainName, context, msgid);
         }
diff --git a/modules/mainloop.c b/modules/mainloop.c
index ffdf260..814619d 100644
--- a/modules/mainloop.c
+++ b/modules/mainloop.c
@@ -43,7 +43,7 @@ gjs_main_loop_quit(JSContext *context,
 {
     char *cancel_id;
     GMainLoop *main_loop;
-    
+
     if (!gjs_parse_args(context, "quit", "s", argc, argv,
                         "cancelId", &cancel_id))
       return JS_FALSE;
@@ -269,7 +269,7 @@ gjs_idle_add(JSContext *context,
     GClosure *closure;
     guint id;
     int priority = G_PRIORITY_DEFAULT_IDLE;
-    
+
     /* Best I can tell, there is no way to know if argv[0] is really
      * callable other than to just try it. Checking whether it's a
      * function will not detect native objects that provide
diff --git a/modules/tweener/tweener.js b/modules/tweener/tweener.js
index fcbbebf..959fa4d 100644
--- a/modules/tweener/tweener.js
+++ b/modules/tweener/tweener.js
@@ -402,19 +402,19 @@ function _constructPropertyList(obj) {
                     var splitProperties2 = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
                     for (let j = 0; j < splitProperties2.length; j++) {
                         properties[splitProperties2[j].name] = {
-			    valueStart: undefined,
-			    valueComplete: splitProperties2[j].value,
-			    arrayIndex: splitProperties2[j].arrayIndex,
-			    isSpecialProperty: false
-			};
+                            valueStart: undefined,
+                            valueComplete: splitProperties2[j].value,
+                            arrayIndex: splitProperties2[j].arrayIndex,
+                            isSpecialProperty: false
+                        };
                     }
                 } else {
                     properties[splitProperties[i].name] = {
-			valueStart: undefined,
-			valueComplete: splitProperties[i].value,
-			arrayIndex: splitProperties[i].arrayIndex,
-			isSpecialProperty: false
-		    };
+                        valueStart: undefined,
+                        valueComplete: splitProperties[i].value,
+                        arrayIndex: splitProperties[i].arrayIndex,
+                        isSpecialProperty: false
+                    };
                 }
             }
         } else if (_specialPropertyModifierList[istr] != undefined) {
@@ -762,9 +762,9 @@ function _affectTweensWithFunction(func, args) {
                 var specialProps = sps.splitValues(scope, null);
                 for (let j = 0; j < specialProps.length; j++)
                     properties.push(specialProps[j].name);
-	    } else
-		properties.push(args[i]);
-	}
+            } else
+                properties.push(args[i]);
+        }
     }
 
     // the return now value means: "affect at least one tween"
@@ -839,14 +839,14 @@ function registerSpecialProperty(name, getFunction, setFunction,
 
 function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {
     _specialPropertyModifierList[name] = {
-	modifyValues: modifyFunction,
-	getValue: getFunction
+        modifyValues: modifyFunction,
+        getValue: getFunction
     };
 }
 
 function registerSpecialPropertySplitter(name, splitFunction, parameters) {
     _specialPropertySplitterList[name] = {
-	splitValues: splitFunction,
-	parameters: parameters
+        splitValues: splitFunction,
+        parameters: parameters
     };
 }
diff --git a/test/js/testEverythingBasic.js b/test/js/testEverythingBasic.js
index 606c7e7..3501cec 100644
--- a/test/js/testEverythingBasic.js
+++ b/test/js/testEverythingBasic.js
@@ -46,10 +46,10 @@ function testLifeUniverseAndEverything() {
     assertEquals(-42, Everything.test_int64(-42));
 
     assertEquals(42, Everything.test_uint64(42));
-    
+
     assertEquals(42, Everything.test_short(42));
     assertEquals(-42, Everything.test_short(-42));
-    
+
     assertEquals(42, Everything.test_ushort(42));
 
     assertEquals(42, Everything.test_int(42));
@@ -116,9 +116,9 @@ function testNoImplicitConversionToUnsigned() {
 
 function testBadConstructor() {
     try {
-	Gio.AppLaunchContext();
+        Gio.AppLaunchContext();
     } catch (e) {
-	assert(e.message.indexOf("Constructor called as normal method") >= 0);
+        assert(e.message.indexOf("Constructor called as normal method") >= 0);
     }
 }
 
@@ -296,17 +296,17 @@ function testArrayOut() {
 // Convert an object to a predictable (not-hash-order-dependent) string
 function objToString(v) {
     if (typeof(v) == "object") {
-	let keys = [];
-	for (let k in v)
-	    keys.push(k);
-	keys.sort();
-	return "{" + keys.map(function(k) {
-	    return k + ":" + objToString(v[k]);
-	}) + "}";
+        let keys = [];
+        for (let k in v)
+            keys.push(k);
+        keys.sort();
+        return "{" + keys.map(function(k) {
+            return k + ":" + objToString(v[k]);
+        }) + "}";
     } else if (typeof(v) == "string") {
-	return '"' + v + '"';
+        return '"' + v + '"';
     } else {
-	return v;
+        return v;
     }
 }
 
diff --git a/test/js/testEverythingEncapsulated.js b/test/js/testEverythingEncapsulated.js
index cee76de..76d5991 100644
--- a/test/js/testEverythingEncapsulated.js
+++ b/test/js/testEverythingEncapsulated.js
@@ -20,9 +20,9 @@ function testStructConstructor()
 {
     // "Copy" an object from a hash of field values
     let struct = new Everything.TestStructA({ some_int: 42,
-					      some_int8: 43,
-					      some_double: 42.5,
-					      some_enum: Everything.TestEnum.VALUE3 });
+                                              some_int8: 43,
+                                              some_double: 42.5,
+                                              some_enum: Everything.TestEnum.VALUE3 });
 
     assertEquals(42, struct.some_int);
     assertEquals(43, struct.some_int8);
@@ -31,7 +31,7 @@ function testStructConstructor()
 
     // Make sure we catch bad field names
     assertRaises(function() {
-	let t = new Everything.TestStructA({ junk: 42 });
+        let t = new Everything.TestStructA({ junk: 42 });
     });
 
     // Copy an object from another object of the same type, shortcuts to memcpy()
@@ -59,9 +59,9 @@ function testBoxedCopyConstructor()
 {
     // "Copy" an object from a hash of field values
     let simple_boxed = new Everything.TestSimpleBoxedA({ some_int: 42,
-							 some_int8: 43,
-							 some_double: 42.5,
-							 some_enum: Everything.TestEnum.VALUE3 });
+                                                         some_int8: 43,
+                                                         some_double: 42.5,
+                                                         some_enum: Everything.TestEnum.VALUE3 });
 
     assertEquals(42, simple_boxed.some_int);
     assertEquals(43, simple_boxed.some_int8);
@@ -70,7 +70,7 @@ function testBoxedCopyConstructor()
 
     // Make sure we catch bad field names
     assertRaises(function() {
-	let t = new Everything.TestSimpleBoxedA({ junk: 42 });
+        let t = new Everything.TestSimpleBoxedA({ junk: 42 });
     });
 
     // Copy an object from another object of the same type, shortcuts to the boxed copy
@@ -101,12 +101,12 @@ function testNestedSimpleBoxed() {
 
     // Try constructing with a nested hash of field values
     let simple2 = new Everything.TestSimpleBoxedB({
-	some_int8: 42,
-	nested_a: {
-	    some_int: 43,
-	    some_int8: 44,
-	    some_double: 43.5
-	}
+        some_int8: 42,
+        nested_a: {
+            some_int: 43,
+            some_int8: 44,
+            some_double: 43.5
+        }
     });
     assertEquals(42, simple2.some_int8);
     assertEquals(43, simple2.nested_a.some_int);
diff --git a/test/js/testTweener.js b/test/js/testTweener.js
index 86d6532..ec22a00 100644
--- a/test/js/testTweener.js
+++ b/test/js/testTweener.js
@@ -334,7 +334,7 @@ function testSpecialProperty() {
     };
 
     Tweener.addTween(objectA, { negative_x: 10, y: 10, time: 1,
-				transition: "linear",
+                                transition: "linear",
                                 onComplete: function() { Mainloop.quit('testSpecialProperty');}});
 
     Mainloop.run('testSpecialProperty');
@@ -346,8 +346,8 @@ function testSpecialProperty() {
 }
 
 Tweener.registerSpecialPropertyModifier('discrete',
-					discrete_modifier,
-					discrete_get);
+                                        discrete_modifier,
+                                        discrete_get);
 function discrete_modifier(props) {
     return props.map(function (prop) { return { name: prop, parameters: null }; });
 }
@@ -359,20 +359,20 @@ function testSpecialPropertyModifier() {
     var objectA = {
         x: 0,
         y: 0,
-	xFraction: false,
-	yFraction: false
+        xFraction: false,
+        yFraction: false
     };
 
     Tweener.addTween(objectA, { x: 10, y: 10, time: 1,
-				discrete: ["x"],
-				transition: "linear",
-				onUpdate: function() {
-				    if (objectA.x != Math.floor(objectA.x))
-					objectA.xFraction = true;
-				    if (objectA.y != Math.floor(objectA.y))
-					objectA.yFraction = true;
-				},
-				onComplete: function() { Mainloop.quit('testSpecialPropertyModifier');}});
+                                discrete: ["x"],
+                                transition: "linear",
+                                onUpdate: function() {
+                                    if (objectA.x != Math.floor(objectA.x))
+                                        objectA.xFraction = true;
+                                    if (objectA.y != Math.floor(objectA.y))
+                                        objectA.yFraction = true;
+                                },
+                                onComplete: function() { Mainloop.quit('testSpecialPropertyModifier');}});
 
     Mainloop.run('testSpecialPropertyModifier');
 
@@ -387,7 +387,7 @@ function testSpecialPropertyModifier() {
 Tweener.registerSpecialPropertySplitter(
     'xnegy',
     function(val) { return [ { name: "x", value: val },
-			     { name: "y", value: -val } ]; }
+                             { name: "y", value: -val } ]; }
 );
 
 function testSpecialPropertySplitter() {
@@ -397,7 +397,7 @@ function testSpecialPropertySplitter() {
     };
 
     Tweener.addTween(objectA, { xnegy: 10, time: 1,
-				transition: "linear",
+                                transition: "linear",
                                 onComplete: function() { Mainloop.quit('testSpecialPropertySplitter');}});
 
     Mainloop.run('testSpecialPropertySplitter');



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]