summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
af0aa4a)
Added spaces between strings and literals. The string handling
code should eventually be replaced with proper C++ versions using
std::string, so for this reason I have not bothered improving them.
Change-Id: I78b871113f4a3891139a412c7831a1e5209bfaec
-#include <assert.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+
+#include <cassert>
+#include <cctype>
+#include <cstring>
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/fatalerror.h"
int i, c;
if (NULL == str)
int i, c;
if (NULL == str)
char *gmx_step_str(gmx_int64_t i, char *buf)
{
char *gmx_step_str(gmx_int64_t i, char *buf)
{
- sprintf(buf, "%"GMX_PRId64, i);
+ sprintf(buf, "%" GMX_PRId64, i);
/*
* This file is part of the GROMACS molecular simulation package.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
+ if (size == 0)
+ {
+ return;
+ }
+
cbase = (char *)base;
swaptype = (size_t)(cbase - (char *)0) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
cbase = (char *)base;
swaptype = (size_t)(cbase - (char *)0) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#include <malloc.h>
#endif
#include <malloc.h>
#endif
#include "thread_mpi/threads.h"
#include "gromacs/utility/dir_separator.h"
#include "thread_mpi/threads.h"
#include "gromacs/utility/dir_separator.h"
if ((p = malloc(size)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
if ((p = malloc(size)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
- "Not enough memory. Failed to malloc %"GMX_PRId64 " bytes for %s\n"
+ "Not enough memory. Failed to malloc %" GMX_PRId64 " bytes for %s\n"
"(called from file %s, line %d)",
(gmx_int64_t)size, name, file, line);
}
"(called from file %s, line %d)",
(gmx_int64_t)size, name, file, line);
}
if ((p = malloc((size_t)nelem*(size_t)elsize)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
if ((p = malloc((size_t)nelem*(size_t)elsize)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
- "Not enough memory. Failed to calloc %"GMX_PRId64
- " elements of size %"GMX_PRId64
+ "Not enough memory. Failed to calloc %" GMX_PRId64
+ " elements of size %" GMX_PRId64
" for %s\n(called from file %s, line %d)",
(gmx_int64_t)nelem, (gmx_int64_t)elsize,
name, file, line);
" for %s\n(called from file %s, line %d)",
(gmx_int64_t)nelem, (gmx_int64_t)elsize,
name, file, line);
if ((p = calloc((size_t)nelem, (size_t)elsize)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
if ((p = calloc((size_t)nelem, (size_t)elsize)) == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
- "Not enough memory. Failed to calloc %"GMX_PRId64
- " elements of size %"GMX_PRId64
+ "Not enough memory. Failed to calloc %" GMX_PRId64
+ " elements of size %" GMX_PRId64
" for %s\n(called from file %s, line %d)",
(gmx_int64_t)nelem, (gmx_int64_t)elsize, name, file, line);
}
" for %s\n(called from file %s, line %d)",
(gmx_int64_t)nelem, (gmx_int64_t)elsize, name, file, line);
}
if (p == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
if (p == NULL)
{
gmx_fatal(errno, __FILE__, __LINE__,
- "Not enough memory. Failed to realloc %"GMX_PRId64 " bytes for %s, %s=%x\n"
+ "Not enough memory. Failed to realloc %" GMX_PRId64 " bytes for %s, %s=%x\n"
"(called from file %s, line %d)",
(gmx_int64_t)size, name, name, ptr, file, line);
}
"(called from file %s, line %d)",
(gmx_int64_t)size, name, name, ptr, file, line);
}
/* This routine can NOT be called with any pointer */
void save_free_aligned(const char gmx_unused *name, const char gmx_unused *file, int gmx_unused line, void *ptr)
{
/* This routine can NOT be called with any pointer */
void save_free_aligned(const char gmx_unused *name, const char gmx_unused *file, int gmx_unused line, void *ptr)
{
void *free = ptr;
if (NULL != ptr)
void *free = ptr;
if (NULL != ptr)
- return OVER_ALLOC_FAC*n + 100;
+ return static_cast<int>(OVER_ALLOC_FAC*n + 100);