diff options
author | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2002-10-24 11:50:23 +0000 |
---|---|---|
committer | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2002-10-24 11:50:23 +0000 |
commit | 022357aedfc4f72963d3b70e14cafea5256dffd2 (patch) | |
tree | 019fbf6927530819697a99c05046db78d37095a8 /src/Storage.c | |
parent | db3b326b5c33424c6b41ef5f8add2c7b7ed2032f (diff) |
Check whether storage allocation succeeded (and issue a warning if not)
only for non-vector group variables.
This closes PR CactusPUGH-1255.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@397 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/Storage.c')
-rw-r--r-- | src/Storage.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Storage.c b/src/Storage.c index 0dfb5f1..f79e937 100644 --- a/src/Storage.c +++ b/src/Storage.c @@ -855,7 +855,8 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH, if(GA->vector_size > 1 && GA->vector_entry > 0) { - GA->data = (char *)(GA->vector_base->data) + GA->extras->npoints * GA->varsize * GA->vector_entry; + GA->data = (char *) GA->vector_base->data + + GA->extras->npoints * GA->varsize * GA->vector_entry; retval = 0; } else @@ -895,14 +896,14 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH, PUGH_InitializeMemory (initialize_memory, GA->vtype, GA->extras->npoints * GA->varsize, GA->data); } - } - if (GA->extras->npoints * GA->varsize > 0 && GA->padddata == NULL) - { - CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, - "PUGH_EnableGArrayDataStorage: Cannot allocate data for " - "'%s' [%d]", GA->name, GA->id); - retval = -1; + if (GA->extras->npoints * GA->varsize > 0 && GA->padddata == NULL) + { + CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, + "PUGH_EnableGArrayDataStorage: Cannot allocate data for " + "'%s' [%d]", GA->name, GA->id); + retval = -1; + } } } |