Cleaning up include statements

Removing inclusion of malloc.h. Adding crtdbg.h
This commit is contained in:
Michael Tryby
2019-03-28 09:26:26 -04:00
parent 8574f52256
commit 1b167b5caf
28 changed files with 164 additions and 169 deletions

View File

@@ -11,12 +11,17 @@
******************************************************************************
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef __APPLE__
#include <malloc.h>
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#else
#include <stdlib.h>
#endif
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <math.h>
@@ -216,26 +221,24 @@ int DLLEXPORT EN_open(EN_Project p, const char *inpFile, const char *rptFile,
ERRCODE(netsize(p));
ERRCODE(allocdata(p));
// Read input data
ERRCODE(getdata(p));
if (!errcode) {
// Read input data
ERRCODE(getdata(p));
// Close input file
if (p->parser.InFile != NULL)
{
// Close input file
if (p->parser.InFile != NULL) {
fclose(p->parser.InFile);
p->parser.InFile = NULL;
}
}
// Free temporary linked lists used for Patterns & Curves
freeTmplist(p->parser.Patlist);
freeTmplist(p->parser.Curvelist);
// Free temporary linked lists used for Patterns & Curves
freeTmplist(p->parser.Patlist);
freeTmplist(p->parser.Curvelist);
// If using previously saved hydraulics file then open it
if (p->outfile.Hydflag == USE) ERRCODE(openhydfile(p));
// If using previously saved hydraulics file then open it
if (p->outfile.Hydflag == USE) ERRCODE(openhydfile(p));
// Write input summary to report file
if (!errcode)
{
// Write input summary to report file
if (p->report.Summaryflag) writesummary(p);
writetime(p, FMT104);
p->Openflag = TRUE;
@@ -279,7 +282,7 @@ int DLLEXPORT EN_getcomment(EN_Project p, int object, int index, char *comment)
/*----------------------------------------------------------------
** Input: object = a type of object (see EN_ObjectType)
** index = the object's index
** Output: comment = the object's descriptive comment
** Output: comment = the object's descriptive comment
** Returns: error code
** Purpose: Retrieves an object's descriptive comment
**----------------------------------------------------------------
@@ -840,7 +843,7 @@ int DLLEXPORT EN_closeQ(EN_Project p)
if (!p->Openflag) return 102;
closequal(p);
p->quality.OpenQflag = FALSE;
closeoutfile(p);
closeoutfile(p);
return 0;
}