Commit 13428231 authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

code style

parent 64722eb1
......@@ -57,7 +57,7 @@ static const char *par_fn_ext[] = {
@author Vesa Oikonen
*/
char *parFormattxt(
/** PAR format code */
/** PAR format code. */
parformat c
) {
if(c<PAR_FORMAT_UNKNOWN || c>=PAR_FORMAT_LAST) return NULL;
......@@ -125,8 +125,7 @@ int parFormatFromExtension(
/*****************************************************************************/
/*****************************************************************************/
/** Return pointer to default PAR file name extension, including the dot,
based on the PAR format code.
/** Return pointer to default PAR file name extension, including the dot, based on the PAR format code.
@return pointer to the file name extension string.
@sa parformat, parFormatFromExtension, parFormattxt, parWrite
@author Vesa Oikonen
......@@ -151,8 +150,8 @@ int parWrite(
PAR *par,
/** Output file pointer. */
FILE *fp,
/** File format code; enter PAR_FORMAT_UNKNOWN (0)
to write data in the format specified inside PAR struct. */
/** File format code; enter PAR_FORMAT_UNKNOWN (0) to write data in the format specified inside
the PAR struct. */
parformat format,
/** Write (1) or do not write (0) also extra header fields found in PAR;
only effective with CSV formats. */
......@@ -236,7 +235,7 @@ int parRead(
PAR *par,
/** Pointer to the file name; this string is not modified. */
const char *fname,
/** Pointer to status data; enter NULL if not needed */
/** Pointer to status data; enter NULL if not needed. */
TPCSTATUS *status
) {
int verbose=0; if(status!=NULL) verbose=status->verbose;
......@@ -353,8 +352,7 @@ int parRead(
IFT hdr; iftInit(&hdr);
iftRead(&hdr, fp, 1, 1, status); fclose(fp);
if(hdr.keyNr>0) {
if(!strcasecmp(hdr.item[0].key, "content") &&
!strcasecmp(hdr.item[0].value, "parameters"))
if(!strcasecmp(hdr.item[0].key, "content") && !strcasecmp(hdr.item[0].value, "parameters"))
format=PAR_FORMAT_IFT;
}
if(format==PAR_FORMAT_IFT) {
......@@ -480,15 +478,14 @@ int parWriteLimits(
/*****************************************************************************/
/*****************************************************************************/
/** Read the specified file and try to find constraints and tolerance for parameters
listed in PAR structure.
/** Read the specified file and try to find constraints and tolerance for parameters listed in PAR structure.
@return enum tpcerror (TPCERROR_OK when successful).
@author Vesa Oikonen
@sa parWriteLimits, parWrite, parFree
*/
int parReadLimits(
/** Pointer to PAR structure, into which the limits are saved. This must also
list the parameter names that are searched for from the file. */
/** Pointer to PAR structure, into which the limits are saved. This must also list the parameter
names that are searched for from the file. */
PAR *par,
/** Input file name. */
const char *fname,
......
......@@ -256,14 +256,12 @@ int main(int argc, char **argv)
}
/*
* If target file does not exist, then save the selected contents in file,
* and quit.
* If target file does not exist, then save the selected contents in file, and quit.
*/
if(newfile) {
if(drymode) {
printf("%d parameter(s) and %d TAC(s) would be written in %s\n",
parNr, tacNr, parfile1);
printf("%d parameter(s) and %d TAC(s) would be written in %s\n", parNr, tacNr, parfile1);
parFree(&par1); parFree(&par2);
return(0);
}
......@@ -288,8 +286,8 @@ int main(int argc, char **argv)
/*
* We are here only if target file exists.
* Read the previous contents.
*/
/* Read the previous contents. */
if(verbose>1) printf("reading %s\n", parfile1);
ret=parRead(&par1, parfile1, &status);
if(ret!=TPCERROR_OK) {
......@@ -366,8 +364,7 @@ int main(int argc, char **argv)
}
/*
* If new and old parameters do match but TACs did not, then add
* new TAC row(s)
* If new and old parameters do match but TACs did not, then add new TAC row(s)
*/
if(samepars) {
......
Markdown is supported
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