[cig-commits] r16008 - mc/3D/CitcomCU/trunk/src

tan2 at geodynamics.org tan2 at geodynamics.org
Thu Nov 19 12:16:35 PST 2009


Author: tan2
Date: 2009-11-19 12:16:34 -0800 (Thu, 19 Nov 2009)
New Revision: 16008

Modified:
   mc/3D/CitcomCU/trunk/src/Output_gzdir.c
   mc/3D/CitcomCU/trunk/src/prototypes.h
Log:
Declar safe_gzopen() as static so that it won't appear in prototypes.h. This would avoid depending on zlib.h when compiling the code. The code will still depend on zlib, but nowaday every unix system has zlib installed by default.

PS: one should avoid hand-editing prototypes.h. This file can be regenerated by running:
    $ cproto -p > a && mv a prototypes.h


Modified: mc/3D/CitcomCU/trunk/src/Output_gzdir.c
===================================================================
--- mc/3D/CitcomCU/trunk/src/Output_gzdir.c	2009-11-19 19:56:47 UTC (rev 16007)
+++ mc/3D/CitcomCU/trunk/src/Output_gzdir.c	2009-11-19 20:16:34 UTC (rev 16008)
@@ -49,19 +49,14 @@
 #include <math.h>
 #include <malloc.h>
 #include <stdlib.h>				/* for "system" command */
-#ifndef __sunos__				/* string manipulations */
-#include <strings.h>
-#else
-#include <string.h>
-#endif
+#include <zlib.h>
 
 
-#include <zlib.h>
 
 #include "element_definitions.h"
 #include "global_defs.h"
 
-gzFile *safe_gzopen(char *,char *);
+static gzFile *safe_gzopen(char *,char *);
 FILE *safe_fopen(char *,char *);
 void *safe_malloc (size_t );
 void calc_cbase_at_tp(float , float , float *);
@@ -547,7 +542,7 @@
 }
 
 /* safe gzopen function */
-gzFile *safe_gzopen(char *name,char *mode)
+static gzFile *safe_gzopen(char *name,char *mode)
 {
   gzFile *tmp;
   char m2[300];

Modified: mc/3D/CitcomCU/trunk/src/prototypes.h
===================================================================
--- mc/3D/CitcomCU/trunk/src/prototypes.h	2009-11-19 19:56:47 UTC (rev 16007)
+++ mc/3D/CitcomCU/trunk/src/prototypes.h	2009-11-19 20:16:34 UTC (rev 16008)
@@ -188,7 +188,6 @@
 void print_field_spectral_regular(struct All_variables *E, float *TG, float *sphc, float *sphs, int proc_loc, char *filen);
 /* Output_gzdir.c */
 void output_velo_related_gzdir(struct All_variables *E, int file_number);
-gzFile *safe_gzopen(char *name, char *mode);
 void process_restart_tc_gzdir(struct All_variables *E);
 /* Pan_problem_misc_functions.c */
 int get_process_identifier(void);
@@ -318,12 +317,3 @@
 int layers(struct All_variables *E, float x3);
 int weak_zones(struct All_variables *E, int node, float t_b);
 float boundary_thickness(struct All_variables *E, float *H);
-#ifdef USE_GGRD
-void convection_initial_temperature_ggrd(struct All_variables *E);
-#endif
-#ifdef USE_GZDIR
-#include "zlib.h"
-void output_velo_related_gzdir(struct All_variables *E, int file_number);
-gzFile *safe_gzopen(char *name, char *mode);
-void process_restart_tc_gzdir(struct All_variables *E);
-#endif



More information about the CIG-COMMITS mailing list