Commit c2751530 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

institution.c::insitutInq*: check instID != UNDEFID (buf fix)

parent e19c5de2
# Makefile.in generated by automake 1.11.5 from Makefile.am.
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -17,23 +17,6 @@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
......@@ -99,12 +82,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libcdi_la_LIBADD =
......@@ -141,11 +118,6 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libcdi_la_SOURCES)
DIST_SOURCES = $(libcdi_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__include_HEADERS_DIST = cdi.h cdi.inc
HEADERS = $(include_HEADERS)
ETAGS = etags
......@@ -481,8 +453,10 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
......@@ -496,6 +470,7 @@ distclean-hdr:
-rm -f config.h stamp-h1
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
......@@ -503,8 +478,6 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
......@@ -535,7 +508,7 @@ clean-noinstLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libcdi.la: $(libcdi_la_OBJECTS) $(libcdi_la_DEPENDENCIES) $(EXTRA_libcdi_la_DEPENDENCIES)
libcdi.la: $(libcdi_la_OBJECTS) $(libcdi_la_DEPENDENCIES)
$(LINK) $(am_libcdi_la_rpath) $(libcdi_la_OBJECTS) $(libcdi_la_LIBADD) $(LIBS)
mostlyclean-compile:
......@@ -632,11 +605,8 @@ clean-libtool:
-rm -rf .libs _libs
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
......@@ -650,7 +620,9 @@ uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
......@@ -751,15 +723,10 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
......
......@@ -189,11 +189,6 @@
/* Version number of package */
#undef VERSION
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
......
......@@ -36,8 +36,7 @@ static void instituteDestroyP ( void * instituteptr );
static void institutePrintP ( void * instituteptr, FILE * fp );
#ifdef USE_MPI
static int instituteGetSizeP ( void * instituteptr, MPI_Comm comm );
static void institutePackP ( void * instituteptr, void *buf, int size,
int *position, MPI_Comm comm );
static void institutePackP ( void * instituteptr, void *buf, int size, int *position, MPI_Comm comm );
static int instituteTxCode ( void );
#endif
......@@ -245,11 +244,12 @@ int institutDef(int center, int subcenter, const char *name, const char *longnam
int institutInqCenter(int instID)
{
institute_t * instituteptr;
institute_t * instituteptr = NULL;
instituteInit ();
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
if ( instID != UNDEFID )
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
return instituteptr ? instituteptr->center : UNDEFID;
}
......@@ -257,11 +257,12 @@ int institutInqCenter(int instID)
int institutInqSubcenter(int instID)
{
institute_t * instituteptr;
institute_t * instituteptr = NULL;
instituteInit ();
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
if ( instID != UNDEFID )
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
return instituteptr ? instituteptr->subcenter: UNDEFID;
}
......@@ -269,11 +270,12 @@ int institutInqSubcenter(int instID)
char *institutInqNamePtr(int instID)
{
institute_t * instituteptr;
institute_t * instituteptr = NULL;
instituteInit ();
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
if ( instID != UNDEFID )
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
return instituteptr ? instituteptr->name : NULL;
}
......@@ -281,11 +283,12 @@ char *institutInqNamePtr(int instID)
char *institutInqLongnamePtr(int instID)
{
institute_t * instituteptr;
institute_t * instituteptr = NULL;
instituteInit ();
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
if ( instID != UNDEFID )
instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
return instituteptr ? instituteptr->longname : NULL;
}
......
......@@ -39,8 +39,7 @@ static void modelDestroyP ( void * modelptr );
static void modelPrintP ( void * modelptr, FILE * fp );
#ifdef USE_MPI
static int modelGetSizeP ( void * modelptr, MPI_Comm comm );
static void modelPackP ( void * modelptr, void * buff, int size,
int *position, MPI_Comm comm);
static void modelPackP ( void * modelptr, void * buff, int size, int *position, MPI_Comm comm);
static int modelTxCode ( void );
#endif
......@@ -68,7 +67,7 @@ model_t *modelNewEntry ( void )
modelptr = (model_t *) xmalloc(sizeof(model_t));
modelDefaultValue ( modelptr );
modelptr->self = reshPut (( void * ) modelptr, &modelOps );
modelptr->used = 1;
modelptr->used = 1;
return (modelptr);
}
......@@ -224,11 +223,12 @@ int modelDef(int instID, int modelgribID, const char *name)
int modelInqInstitut(int modelID)
{
model_t *modelptr;
model_t *modelptr = NULL;
modelInit ();
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
if ( modelID != UNDEFID )
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
return modelptr ? modelptr->instID : UNDEFID;
}
......@@ -236,11 +236,12 @@ int modelInqInstitut(int modelID)
int modelInqGribID(int modelID)
{
model_t *modelptr;
model_t *modelptr = NULL;
modelInit ();
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
if ( modelID != UNDEFID )
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
return modelptr ? modelptr->modelgribID : UNDEFID;
}
......@@ -248,11 +249,12 @@ int modelInqGribID(int modelID)
char *modelInqNamePtr(int modelID)
{
model_t *modelptr;
model_t *modelptr = NULL;
modelInit ();
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
if ( modelID != UNDEFID )
modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
return modelptr ? modelptr->name : NULL;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment