This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] python/*.c white space


add blank line between decls and statements
2010-05-17  Michael Snyder  <msnyder@vmware.com>

	* python/py-auto-load.c: White space.
	* python/py-block.c: White space.
	* python/py-breakpoint.c: White space.
	* python/py-cmd.c: White space.
	* python/py-function.c: White space.
	* python/py-lazy-string.c: White space.
	* python/py-objfile.c: White space.
	* python/py-param.c: White space.
	* python/py-prettyprint.c: White space.
	* python/py-progspace.c: White space.
	* python/py-symtab.c: White space.
	* python/python.c: White space.
	* python/py-type.c: White space.
	* python/py-utils.c: White space.
	* python/py-value.c: White space.

Index: py-auto-load.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-auto-load.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-auto-load.c
--- py-auto-load.c	27 Apr 2010 16:36:02 -0000	1.3
+++ py-auto-load.c	17 May 2010 21:22:35 -0000
@@ -128,6 +128,7 @@ static hashval_t
 hash_loaded_script_entry (const void *data)
 {
   const struct loaded_script_entry *e = data;
+
   return htab_hash_string (e->name);
 }
 
@@ -138,6 +139,7 @@ eq_loaded_script_entry (const void *a, c
 {
   const struct loaded_script_entry *ea = a;
   const struct loaded_script_entry *eb = b;
+
   return strcmp (ea->name, eb->name) == 0;
 }
 
@@ -202,6 +204,7 @@ source_section_scripts (struct objfile *
       if (p == end)
 	{
 	  char *buf = alloca (p - file + 1);
+
 	  memcpy (buf, file, p - file);
 	  buf[p - file] = '\0';
 	  warning (_("Non-null-terminated path in %s: %s"),
@@ -236,6 +239,7 @@ source_section_scripts (struct objfile *
       if (! in_hash_table)
 	{
 	  char *p;
+
 	  *slot = xmalloc (sizeof (**slot)
 			   + strlen (file) + 1
 			   + (opened ? (strlen (full_path) + 1) : 0));
Index: py-block.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-block.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-block.c
--- py-block.c	7 May 2010 19:26:30 -0000	1.3
+++ py-block.c	17 May 2010 21:22:35 -0000
@@ -259,6 +259,7 @@ static void
 blpy_block_syms_dealloc (PyObject *obj)
 {
   block_syms_iterator_object *iter_obj = (block_syms_iterator_object *) obj;
+
   Py_XDECREF (iter_obj->source);
 }
 
@@ -300,6 +301,7 @@ static void
 del_objfile_blocks (struct objfile *objfile, void *datum)
 {
   block_object *obj = datum;
+
   while (obj)
     {
       block_object *next = obj->next;
Index: py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-breakpoint.c,v
retrieving revision 1.2
diff -u -p -r1.2 py-breakpoint.c
--- py-breakpoint.c	7 May 2010 19:26:30 -0000	1.2
+++ py-breakpoint.c	17 May 2010 21:22:36 -0000
@@ -642,6 +642,7 @@ gdbpy_breakpoints (PyObject *self, PyObj
   if (result)
     {
       int i, out = 0;
+
       for (i = 0; out < bppy_live; ++i)
 	{
 	  if (! bppy_breakpoints[i])
@@ -684,6 +685,7 @@ gdbpy_breakpoint_created (int num)
   if (num >= bppy_slots)
     {
       int old = bppy_slots;
+
       bppy_slots = bppy_slots * 2 + 10;
       bppy_breakpoints
 	= (breakpoint_object **) xrealloc (bppy_breakpoints,
Index: py-cmd.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-cmd.c,v
retrieving revision 1.5
diff -u -p -r1.5 py-cmd.c
--- py-cmd.c	7 May 2010 19:26:30 -0000	1.5
+++ py-cmd.c	17 May 2010 21:22:36 -0000
@@ -156,8 +156,8 @@ cmdpy_function (struct cmd_list_element 
 	  /* Make a temporary copy of the string data.  */
 	  char *s = PyString_AsString (pvalue);
 	  char *copy = alloca (strlen (s) + 1);
-	  strcpy (copy, s);
 
+	  strcpy (copy, s);
 	  PyErr_Restore (ptype, pvalue, ptraceback);
 	  gdbpy_print_stack ();
 	  error (_("Error occurred in Python command: %s"), copy);
@@ -217,6 +217,7 @@ cmdpy_completer (struct cmd_list_element
     {
       Py_ssize_t i, len = PySequence_Size (resultobj);
       Py_ssize_t out;
+
       if (len < 0)
 	goto done;
 
@@ -224,6 +225,7 @@ cmdpy_completer (struct cmd_list_element
       for (i = out = 0; i < len; ++i)
 	{
 	  PyObject *elt = PySequence_GetItem (resultobj, i);
+
 	  if (elt == NULL || ! gdbpy_is_string (elt))
 	    {
 	      /* Skip problem elements.  */
@@ -240,6 +242,7 @@ cmdpy_completer (struct cmd_list_element
       /* User code may also return one of the completion constants,
 	 thus requesting that sort of completion.  */
       long value = PyInt_AsLong (resultobj);
+
       if (value >= 0 && value < (long) N_COMPLETERS)
 	result = completers[value].completer (command, text, word);
     }
@@ -438,6 +441,7 @@ cmdpy_init (PyObject *self, PyObject *ar
   if (PyObject_HasAttr (self, gdbpy_doc_cst))
     {
       PyObject *ds_obj = PyObject_GetAttr (self, gdbpy_doc_cst);
+
       if (ds_obj && gdbpy_is_string (ds_obj))
 	docstring = python_string_to_host_string (ds_obj);
     }
Index: py-function.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-function.c,v
retrieving revision 1.4
diff -u -p -r1.4 py-function.c
--- py-function.c	7 May 2010 19:26:30 -0000	1.4
+++ py-function.c	17 May 2010 21:22:36 -0000
@@ -38,6 +38,7 @@ convert_values_to_python (int argc, stru
 {
   int i;
   PyObject *result = PyTuple_New (argc);
+
   for (i = 0; i < argc; ++i)
     {
       PyObject *elt = value_to_value_object (argv[i]);
@@ -103,6 +104,7 @@ static int
 fnpy_init (PyObject *self, PyObject *args, PyObject *kwds)
 {
   char *name, *docstring = NULL;
+
   if (! PyArg_ParseTuple (args, "s", &name))
     return -1;
   Py_INCREF (self);
Index: py-lazy-string.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-lazy-string.c,v
retrieving revision 1.5
diff -u -p -r1.5 py-lazy-string.c
--- py-lazy-string.c	14 Apr 2010 13:18:54 -0000	1.5
+++ py-lazy-string.c	17 May 2010 21:22:36 -0000
@@ -52,6 +52,7 @@ static PyObject *
 stpy_get_address (PyObject *self, void *closure)
 {
   lazy_string_object *self_string = (lazy_string_object *) self;
+
   return PyLong_FromUnsignedLongLong (self_string->address);
 }
 
@@ -78,6 +79,7 @@ static PyObject *
 stpy_get_length (PyObject *self, void *closure)
 {
   lazy_string_object *self_string = (lazy_string_object *) self;
+
   return PyLong_FromLong (self_string->length);
 }
 
@@ -85,6 +87,7 @@ PyObject *
 stpy_get_type (PyObject *self, void *closure)
 {
   lazy_string_object *str_obj = (lazy_string_object *) self;
+
   return type_to_type_object (str_obj->type);
 }
 
@@ -109,6 +112,7 @@ static void
 stpy_dealloc (PyObject *self)
 {
   lazy_string_object *self_string = (lazy_string_object *) self;
+
   xfree (self_string->encoding);
 }
 
Index: py-objfile.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-objfile.c,v
retrieving revision 1.5
diff -u -p -r1.5 py-objfile.c
--- py-objfile.c	7 May 2010 19:26:30 -0000	1.5
+++ py-objfile.c	17 May 2010 21:22:36 -0000
@@ -45,6 +45,7 @@ static PyObject *
 objfpy_get_filename (PyObject *self, void *closure)
 {
   objfile_object *obj = (objfile_object *) self;
+
   if (obj->objfile && obj->objfile->name)
     return PyString_Decode (obj->objfile->name, strlen (obj->objfile->name),
 			    host_charset (), NULL);
@@ -55,6 +56,7 @@ static void
 objfpy_dealloc (PyObject *o)
 {
   objfile_object *self = (objfile_object *) o;
+
   Py_XDECREF (self->printers);
   self->ob_type->tp_free ((PyObject *) self);
 }
@@ -63,6 +65,7 @@ static PyObject *
 objfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
 {
   objfile_object *self = (objfile_object *) type->tp_alloc (type, 0);
+
   if (self)
     {
       self->objfile = NULL;
@@ -81,6 +84,7 @@ PyObject *
 objfpy_get_printers (PyObject *o, void *ignore)
 {
   objfile_object *self = (objfile_object *) o;
+
   Py_INCREF (self->printers);
   return self->printers;
 }
@@ -90,6 +94,7 @@ objfpy_set_printers (PyObject *o, PyObje
 {
   PyObject *tmp;
   objfile_object *self = (objfile_object *) o;
+
   if (! value)
     {
       PyErr_SetString (PyExc_TypeError,
Index: py-param.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-param.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-param.c
--- py-param.c	7 May 2010 19:26:30 -0000	1.3
+++ py-param.c	17 May 2010 21:22:36 -0000
@@ -103,6 +103,7 @@ get_attr (PyObject *obj, PyObject *attr_
       && ! strcmp (PyString_AsString (attr_name), "value"))
     {
       parmpy_object *self = (parmpy_object *) obj;
+
       return gdbpy_parameter_value (self->type, &self->value);
     }
 
@@ -394,6 +395,7 @@ compute_enum_values (parmpy_object *self
   for (i = 0; i < size; ++i)
     {
       PyObject *item = PySequence_GetItem (enum_values, i);
+
       if (! item)
 	return 0;
       if (! gdbpy_is_string (item))
@@ -414,9 +416,11 @@ static char *
 get_doc_string (PyObject *object, PyObject *attr)
 {
   char *result = NULL;
+
   if (PyObject_HasAttr (object, attr))
     {
       PyObject *ds_obj = PyObject_GetAttr (object, attr);
+
       if (ds_obj && gdbpy_is_string (ds_obj))
 	result = python_string_to_host_string (ds_obj);
     }
Index: py-prettyprint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-prettyprint.c,v
retrieving revision 1.9
diff -u -p -r1.9 py-prettyprint.c
--- py-prettyprint.c	7 May 2010 19:26:30 -0000	1.9
+++ py-prettyprint.c	17 May 2010 21:22:36 -0000
@@ -319,6 +319,7 @@ py_restore_tstate (void *p)
 {
   PyFrameObject *frame = p;
   PyThreadState *tstate = PyThreadState_GET ();
+
   tstate->frame = frame;
 }
 
Index: py-progspace.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-progspace.c,v
retrieving revision 1.2
diff -u -p -r1.2 py-progspace.c
--- py-progspace.c	7 May 2010 19:26:30 -0000	1.2
+++ py-progspace.c	17 May 2010 21:22:36 -0000
@@ -47,9 +47,11 @@ static PyObject *
 pspy_get_filename (PyObject *self, void *closure)
 {
   pspace_object *obj = (pspace_object *) self;
+
   if (obj->pspace)
     {
       struct objfile *objfile = obj->pspace->symfile_object_file;
+
       if (objfile && objfile->name)
 	return PyString_Decode (objfile->name, strlen (objfile->name),
 				host_charset (), NULL);
@@ -61,6 +63,7 @@ static void
 pspy_dealloc (PyObject *self)
 {
   pspace_object *ps_self = (pspace_object *) self;
+
   Py_XDECREF (ps_self->printers);
   self->ob_type->tp_free (self);
 }
@@ -69,6 +72,7 @@ static PyObject *
 pspy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
 {
   pspace_object *self = (pspace_object *) type->tp_alloc (type, 0);
+
   if (self)
     {
       self->pspace = NULL;
@@ -87,6 +91,7 @@ PyObject *
 pspy_get_printers (PyObject *o, void *ignore)
 {
   pspace_object *self = (pspace_object *) o;
+
   Py_INCREF (self->printers);
   return self->printers;
 }
@@ -96,6 +101,7 @@ pspy_set_printers (PyObject *o, PyObject
 {
   PyObject *tmp;
   pspace_object *self = (pspace_object *) o;
+
   if (! value)
     {
       PyErr_SetString (PyExc_TypeError,
Index: py-symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-symtab.c,v
retrieving revision 1.2
diff -u -p -r1.2 py-symtab.c
--- py-symtab.c	7 May 2010 19:26:30 -0000	1.2
+++ py-symtab.c	17 May 2010 21:22:36 -0000
@@ -322,8 +322,8 @@ symtab_and_line_to_sal_object (struct sy
 {
   sal_object *sal_obj;
   int success = 0;
-  sal_obj = PyObject_New (sal_object, &sal_object_type);
 
+  sal_obj = PyObject_New (sal_object, &sal_object_type);
   if (sal_obj)
     {
       success = set_sal (sal_obj, sal);
@@ -365,6 +365,7 @@ static void
 del_objfile_symtab (struct objfile *objfile, void *datum)
 {
   symtab_object *obj = datum;
+
   while (obj)
     {
       symtab_object *next = obj->next;
@@ -385,6 +386,7 @@ static void
 del_objfile_sal (struct objfile *objfile, void *datum)
 {
   sal_object *obj = datum;
+
   while (obj)
     {
       sal_object *next = obj->next;
Index: python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.35
diff -u -p -r1.35 python.c
--- python.c	7 May 2010 19:26:30 -0000	1.35
+++ python.c	17 May 2010 21:22:36 -0000
@@ -77,6 +77,7 @@ static void
 restore_python_env (void *p)
 {
   struct python_env *env = (struct python_env *)p;
+
   PyGILState_Release (env->state);
   python_gdbarch = env->gdbarch;
   python_language = env->language;
@@ -124,6 +125,7 @@ compute_python_string (struct command_li
   for (iter = l; iter; iter = iter->next)
     {
       int len = strlen (iter->line);
+
       strcpy (&script[here], iter->line);
       here += len;
       script[here++] = '\n';
@@ -165,8 +167,8 @@ static void
 python_command (char *arg, int from_tty)
 {
   struct cleanup *cleanup;
-  cleanup = ensure_python_env (get_current_arch (), current_language);
 
+  cleanup = ensure_python_env (get_current_arch (), current_language);
   while (arg && *arg && isspace (*arg))
     ++arg;
   if (arg && *arg)
@@ -180,6 +182,7 @@ python_command (char *arg, int from_tty)
   else
     {
       struct command_line *l = get_command_line (python_control, "");
+
       make_cleanup_free_command_lines (&l);
       execute_control_command_untraced (l);
     }
@@ -204,6 +207,7 @@ gdbpy_parameter_value (enum var_types ty
     case var_enum:
       {
 	char *str = * (char **) var;
+
 	if (! str)
 	  str = "";
 	return PyString_Decode (str, strlen (str), host_charset (), NULL);
@@ -220,6 +224,7 @@ gdbpy_parameter_value (enum var_types ty
     case var_auto_boolean:
       {
 	enum auto_boolean ab = * (enum auto_boolean *) var;
+
 	if (ab == AUTO_BOOLEAN_TRUE)
 	  Py_RETURN_TRUE;
 	else if (ab == AUTO_BOOLEAN_FALSE)
@@ -238,6 +243,7 @@ gdbpy_parameter_value (enum var_types ty
     case var_uinteger:
       {
 	unsigned int val = * (unsigned int *) var;
+
 	if (val == UINT_MAX)
 	  Py_RETURN_NONE;
 	return PyLong_FromUnsignedLong (val);
@@ -286,6 +292,7 @@ static PyObject *
 gdbpy_target_charset (PyObject *self, PyObject *args)
 {
   const char *cset = target_charset (python_gdbarch);
+
   return PyUnicode_Decode (cset, strlen (cset), host_charset (), NULL);
 }
 
@@ -295,6 +302,7 @@ static PyObject *
 gdbpy_target_wide_charset (PyObject *self, PyObject *args)
 {
   const char *cset = target_wide_charset (python_gdbarch);
+
   return PyUnicode_Decode (cset, strlen (cset), host_charset (), NULL);
 }
 
@@ -326,6 +334,7 @@ execute_gdb_command (PyObject *self, PyO
       /* Copy the argument text in case the command modifies it.  */
       char *copy = xstrdup (arg);
       struct cleanup *cleanup = make_cleanup (xfree, copy);
+
       execute_command (copy, from_tty);
       do_cleanups (cleanup);
     }
@@ -383,6 +392,7 @@ static PyObject *
 gdbpy_write (PyObject *self, PyObject *args)
 {
   char *arg;
+
   if (! PyArg_ParseTuple (args, "s", &arg))
     return NULL;
   printf_filtered ("%s", arg);
@@ -440,6 +450,7 @@ gdbpy_progspaces (PyObject *unused1, PyO
   ALL_PSPACES (ps)
   {
     PyObject *item = pspace_to_pspace_object (ps);
+
     if (!item || PyList_Append (list, item) == -1)
       {
 	Py_DECREF (list);
@@ -509,6 +520,7 @@ gdbpy_objfiles (PyObject *unused1, PyObj
   ALL_OBJFILES (objf)
   {
     PyObject *item = objfile_to_objfile_object (objf);
+
     if (!item || PyList_Append (list, item) == -1)
       {
 	Py_DECREF (list);
@@ -534,6 +546,7 @@ python_command (char *arg, int from_tty)
     {
       struct command_line *l = get_command_line (python_control, "");
       struct cleanup *cleanups = make_cleanup_free_command_lines (&l);
+
       execute_control_command_untraced (l);
       do_cleanups (cleanups);
     }
Index: py-type.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-type.c,v
retrieving revision 1.9
diff -u -p -r1.9 py-type.c
--- py-type.c	7 May 2010 19:26:30 -0000	1.9
+++ py-type.c	17 May 2010 21:22:36 -0000
@@ -101,6 +101,7 @@ static void
 field_dealloc (PyObject *obj)
 {
   field_object *f = (field_object *) obj;
+
   Py_XDECREF (f->dict);
   f->ob_type->tp_free (obj);
 }
@@ -109,6 +110,7 @@ static PyObject *
 field_new (void)
 {
   field_object *result = PyObject_New (field_object, &field_object_type);
+
   if (result)
     {
       result->dict = PyDict_New ();
@@ -128,6 +130,7 @@ static PyObject *
 typy_get_code (PyObject *self, void *closure)
 {
   struct type *type = ((type_object *) self)->type;
+
   return PyInt_FromLong (TYPE_CODE (type));
 }
 
@@ -222,6 +225,7 @@ typy_fields (PyObject *self, PyObject *a
   for (i = 0; i < TYPE_NFIELDS (type); ++i)
     {
       PyObject *dict = convert_field (type, i);
+
       if (!dict)
 	{
 	  Py_DECREF (result);
@@ -243,6 +247,7 @@ static PyObject *
 typy_get_tag (PyObject *self, void *closure)
 {
   struct type *type = ((type_object *) self)->type;
+
   if (!TYPE_TAG_NAME (type))
     Py_RETURN_NONE;
   return PyString_FromString (TYPE_TAG_NAME (type));
@@ -439,6 +444,7 @@ typy_lookup_typename (char *type_name, s
 {
   struct type *type = NULL;
   volatile struct gdb_exception except;
+
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
       if (!strncmp (type_name, "struct ", 7))
@@ -675,6 +681,7 @@ typy_dealloc (PyObject *obj)
     {
       /* Must reset head of list.  */
       struct objfile *objfile = TYPE_OBJFILE (type->type);
+
       if (objfile)
 	set_objfile_data (objfile, typy_objfile_data_key, type->next);
     }
Index: py-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-utils.c,v
retrieving revision 1.3
diff -u -p -r1.3 py-utils.c
--- py-utils.c	5 Mar 2010 20:18:17 -0000	1.3
+++ py-utils.c	17 May 2010 21:22:36 -0000
@@ -29,6 +29,7 @@ static void
 py_decref (void *p)
 {
   PyObject *py = p;
+
   /* Note that we need the extra braces in this 'if' to avoid a
      warning from gcc.  */
   if (py)
Index: py-value.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-value.c,v
retrieving revision 1.10
diff -u -p -r1.10 py-value.c
--- py-value.c	14 May 2010 11:11:27 -0000	1.10
+++ py-value.c	17 May 2010 21:22:36 -0000
@@ -207,6 +207,7 @@ static PyObject *
 valpy_get_type (PyObject *self, void *closure)
 {
   value_object *obj = (value_object *) self;
+
   if (!obj->type)
     {
       obj->type = type_to_type_object (value_type (obj->value));
@@ -356,11 +357,13 @@ valpy_getitem (PyObject *self, PyObject 
 	     value code throw an exception if the index has an invalid
 	     type.  */
 	  struct value *idx = convert_value_from_python (key);
+
 	  if (idx != NULL)
 	    {
 	      /* Check the value's type is something that can be accessed via
 		 a subscript.  */
 	      struct type *type;
+
 	      tmp = coerce_ref (tmp);
 	      type = check_typedef (value_type (tmp));
 	      if (TYPE_CODE (type) != TYPE_CODE_ARRAY
@@ -632,6 +635,7 @@ static PyObject *
 valpy_absolute (PyObject *self)
 {
   struct value *value = ((value_object *) self)->value;
+
   if (value_less (value, value_zero (value_type (value), not_lval)))
     return valpy_negative (self);
   else
@@ -917,6 +921,7 @@ struct value *
 value_object_to_value (PyObject *self)
 {
   value_object *real;
+
   if (! PyObject_TypeCheck (self, &value_object_type))
     return NULL;
   real = (value_object *) self;
@@ -984,6 +989,7 @@ convert_value_from_python (PyObject *obj
 	{
 	  PyObject *result;
 	  PyObject *function = PyString_FromString ("value");
+
 	  result = PyObject_CallMethodObjArgs (obj, function,  NULL);
 	  value = value_copy (((value_object *) result)->value);
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]