r16754 - gnucash/trunk - 1) Make some function parameters const

Phil Longstaff plongstaff at cvs.gnucash.org
Thu Dec 27 21:27:58 EST 2007


Author: plongstaff
Date: 2007-12-27 21:27:57 -0500 (Thu, 27 Dec 2007)
New Revision: 16754
Trac: http://svn.gnucash.org/trac/changeset/16754

Modified:
   gnucash/trunk/packaging/win32/
   gnucash/trunk/src/engine/gnc-commodity.c
   gnucash/trunk/src/engine/gnc-commodity.h
Log:
1) Make some function parameters const
2) Add '.deps' to svn:ignore




Property changes on: gnucash/trunk/packaging/win32
___________________________________________________________________
Name: svn:ignore
   - gnucash.iss
custom.sh
Makefile.in
Makefile

   + gnucash.iss
custom.sh
Makefile.in
Makefile
.deps


Modified: gnucash/trunk/src/engine/gnc-commodity.c
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.c	2007-12-28 01:30:20 UTC (rev 16753)
+++ gnucash/trunk/src/engine/gnc-commodity.c	2007-12-28 02:27:57 UTC (rev 16754)
@@ -373,7 +373,7 @@
  * Accessor functions - get functions only. There are no set functions.
  ********************************************************************/
 QuoteSourceType
-gnc_quote_source_get_type (gnc_quote_source *source)
+gnc_quote_source_get_type (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -386,7 +386,7 @@
 }
 
 gint
-gnc_quote_source_get_index (gnc_quote_source *source)
+gnc_quote_source_get_index (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -399,7 +399,7 @@
 }
 
 gboolean
-gnc_quote_source_get_supported (gnc_quote_source *source)
+gnc_quote_source_get_supported (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -412,7 +412,7 @@
 }
 
 const char *
-gnc_quote_source_get_user_name (gnc_quote_source *source)
+gnc_quote_source_get_user_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -424,7 +424,7 @@
 }
 
 const char *
-gnc_quote_source_get_old_internal_name (gnc_quote_source *source)
+gnc_quote_source_get_old_internal_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -436,7 +436,7 @@
 }
 
 const char *
-gnc_quote_source_get_internal_name (gnc_quote_source *source)
+gnc_quote_source_get_internal_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -454,11 +454,11 @@
  * installed.
  ********************************************************************/
 void
-gnc_quote_source_set_fq_installed (GList *sources_list)
+gnc_quote_source_set_fq_installed (const GList *sources_list)
 {
   gnc_quote_source *source;
   char *source_name;
-  GList *node;
+  const GList *node;
 
   ENTER(" ");
   fq_is_installed = TRUE;
@@ -644,7 +644,7 @@
 }
 
 void
-gnc_commodity_copy(gnc_commodity * dest, gnc_commodity *src)
+gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src)
 {
   gnc_commodity_set_fullname (dest, src->fullname);
   dest->namespace = src->namespace;
@@ -658,7 +658,7 @@
 }
 
 gnc_commodity *
-gnc_commodity_clone(gnc_commodity *src, QofBook *dest_book)
+gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book)
 {
   gnc_commodity * dest = g_object_new(GNC_TYPE_COMMODITY, NULL);
   qof_instance_init_data (&dest->inst, GNC_ID_COMMODITY, dest_book);
@@ -1204,7 +1204,7 @@
  *                   Namespace functions                    *
  ************************************************************/
 const char *
-gnc_commodity_namespace_get_name (gnc_commodity_namespace *ns)
+gnc_commodity_namespace_get_name (const gnc_commodity_namespace *ns)
 {
   if (ns == NULL)
     return NULL;
@@ -1261,7 +1261,7 @@
 }
 
 gnc_commodity *
-gnc_commodity_obtain_twin (gnc_commodity *from, QofBook *book)
+gnc_commodity_obtain_twin (const gnc_commodity *from, QofBook *book)
 {
   gnc_commodity *twin;
   const char * ucom;
@@ -1287,7 +1287,7 @@
  ********************************************************************/
 
 guint
-gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl)
+gnc_commodity_table_get_number_of_namespaces(const gnc_commodity_table* tbl)
 {
     g_return_val_if_fail(tbl, 0);
     g_return_val_if_fail(tbl->ns_table, 0);
@@ -1312,7 +1312,7 @@
 }
 
 guint
-gnc_commodity_table_get_size(gnc_commodity_table* tbl)
+gnc_commodity_table_get_size(const gnc_commodity_table* tbl)
 {
     guint count = 0;
     g_return_val_if_fail(tbl, 0);

Modified: gnucash/trunk/src/engine/gnc-commodity.h
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.h	2007-12-28 01:30:20 UTC (rev 16753)
+++ gnucash/trunk/src/engine/gnc-commodity.h	2007-12-28 02:27:57 UTC (rev 16754)
@@ -149,7 +149,7 @@
  *  @param sources_list A list of strings containing the source names
  *  as they are known to F::Q.
  */
-void gnc_quote_source_set_fq_installed (GList *sources_list);
+void gnc_quote_source_set_fq_installed (const GList *sources_list);
 
 /** Return the number of entries for a given type of quote source.
  *
@@ -202,7 +202,7 @@
  *
  *  @return TRUE if the user's computer supports this quote source.
  */
-gboolean gnc_quote_source_get_supported (gnc_quote_source *source);
+gboolean gnc_quote_source_get_supported (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the type of this
  *  particular quote source. (SINGLE, MULTI, UNKNOWN)
@@ -211,7 +211,7 @@
  *
  *  @return The type of this quote source.
  */
-QuoteSourceType gnc_quote_source_get_type (gnc_quote_source *source);
+QuoteSourceType gnc_quote_source_get_type (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the index of this
  *  particular quote source within its type.
@@ -220,7 +220,7 @@
  *
  *  @return The index of this quote source in its type.
  */
-gint gnc_quote_source_get_index (gnc_quote_source *source);
+gint gnc_quote_source_get_index (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the user friendly
  *  name of this quote source.  E.G. "Yahoo Australia" or "Australia
@@ -230,7 +230,7 @@
  *
  *  @return The user friendly name.
  */
-const char *gnc_quote_source_get_user_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_user_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -240,7 +240,7 @@
  *
  *  @return The internal name.
  */
-const char *gnc_quote_source_get_internal_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_internal_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -254,7 +254,7 @@
  *
  *  @return The internal name.
  */
-const char *gnc_quote_source_get_old_internal_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_old_internal_name (const gnc_quote_source *source);
 /** @} */
 
 
@@ -309,10 +309,10 @@
 void  gnc_commodity_destroy(gnc_commodity * cm);
 
 /** Copy src into dest */
-void  gnc_commodity_copy(gnc_commodity * dest, gnc_commodity *src);
+void  gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src);
 
 /** allocate and copy */
-gnc_commodity * gnc_commodity_clone(gnc_commodity *src, QofBook *dest_book);
+gnc_commodity * gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book);
 /** @} */
 
 
@@ -768,7 +768,7 @@
  *
  *  @return A pointer to the name of the namespace.  This string is
  *  owned by the engine and should not be freed by the caller. */
-const char * gnc_commodity_namespace_get_name (gnc_commodity_namespace *ns) ;
+const char * gnc_commodity_namespace_get_name (const gnc_commodity_namespace *ns) ;
 
 
 /** Return a list of all commodity data structures in the specified namespace.
@@ -785,7 +785,7 @@
  *
  *  @return The number of namespaces.  Zero if an invalid argument was
  *  supplied or there was an error. */
-guint gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl);
+guint gnc_commodity_table_get_number_of_namespaces(const gnc_commodity_table* tbl);
 
 /** Test to see if the indicated namespace exits in the commodity table.
  *
@@ -862,7 +862,7 @@
  *
  *  @return The number of commodities in the table. 0 if there are no
  *  commodities, or the routine was passed a bad argument. */
-guint gnc_commodity_table_get_size(gnc_commodity_table* tbl);
+guint gnc_commodity_table_get_size(const gnc_commodity_table* tbl);
 
 /** Return a list of all commodities in the commodity table that are
  *  in the given namespace.
@@ -943,7 +943,7 @@
  *   the indicated book.  This routine is primarily useful for setting
  *   up clones of things across multiple books.
  */
-gnc_commodity * gnc_commodity_obtain_twin (gnc_commodity *from, QofBook *book);
+gnc_commodity * gnc_commodity_obtain_twin (const gnc_commodity *from, QofBook *book);
 
 /** You should probably not be using gnc_commodity_table_register()
  * It is an internal routine for registering the gncObject for the



More information about the gnucash-changes mailing list