anouar27
Messages postés2Date d'inscriptionmercredi 7 décembre 2005StatutMembreDernière intervention11 août 2008
-
11 août 2008 à 12:57
anouar27
Messages postés2Date d'inscriptionmercredi 7 décembre 2005StatutMembreDernière intervention11 août 2008
-
11 août 2008 à 16:47
Bjr,
Je fais de la programmation sur la Personnalisation d'un logiciel Pro/Engineer pour des clients.
J'ai eu un prblm de compilation, ça retourne les erreurs suivantes:
- error C2059:syntax error : 'type'
- NMAKE : fatal error U1077: 'cl' : return code '0x2'
voila le code source:j'ai marqué en rouge la ligne où il y à l'erreur dans le code.
###########################################################################
/*--------------------------------------------------------------------*\
Pro/TOOLKIT includes
\*--------------------------------------------------------------------*/
#include "ProToolkit.h"
#include "ProArray.h"
/*--------------------------------------------------------------------*\
C System includes
\*--------------------------------------------------------------------*/
#include <time.h>
#include <string.h>
#include <stdlib.h>
/*--------------------------------------------------------------------*\
Application includes
\*--------------------------------------------------------------------*/
#include "TestError.h"
/*====================================================================*\
Function : ProTestStatisticCmp()
Purpose : compare two files by version
\*====================================================================*/
int ProTestStatisticCmp(TestStatistic *st1, TestStatistic *st2)
{
int call_result;
call_result = strncmp (st1->call, st2->call, MAX_STAT_SIZE);
if (call_result == 0)
{
call_result = st1->status - st2->status;
}
return (call_result);
}
/*====================================================================*\
FUNCTION : ProTestStatisticWrite()
PURPOSE : Write the specified params to the statistic file.
\*====================================================================*/
int ProTestStatisticWrite (char *call, char *from, ProError status)
{
int i, line_num, line_found = 0;
TestStatistic line;
ProArraySizeGet ((ProArray)statistic, &line_num);
if (errlog_fp == NULL)
return (0);
for (i = 0; i < line_num; i++)
{
if (strncmp (statistic[i].call, call, MAX_STAT_SIZE)==0)
{
if (statistic[i].status == status)
{
statistic[i].num++;
line_found = 1;
break;
}
}
}
if (!line_found)
{
strncpy (line.call, call, MAX_STAT_SIZE);
if (strlen (call) >= MAX_STAT_SIZE)
{
line.call[MAX_STAT_SIZE-4] = '\0';
strcat (line.call, "..");
}
line.status = status;
line.num = 1;
ProArrayObjectAdd ((ProArray*)&statistic, PRO_VALUE_UNUSED,
1, &line);
if (line_num > 1)
{
qsort(statistic, line_num+1, sizeof(TestStatistic),
int *(PRO_CONST_ARG void *, PRO_CONST_ARG void *), // C'est la ou j'ai l'erreur C2059
ProTestStatisticCmp);
}
}
return (1);
}
/* ====================================================================*\
FUNCTION : TEST_CALL_REPORT
PURPOSE : report a Pro/TOOLKIT function call, and status,
if status expression false
call = name of Pro/TOOLKIT function
from = name of function calling the Pro/Toolkit function
status = status returned by Pro/Toolkit function
error = BOOLEAN expression whether status is reportable
\*====================================================================*/
void ProTestCallReport(char *call, char *from, ProError status,int error)
{
int i, mode;
char str[100], *p_ch, line[100];
if (error)
{
strcpy(line, call);
p_ch = strchr(line, '(');
if (p_ch != NULL)
*p_ch = '\0';
for (i=0; i<sizeof(permited_errors)/sizeof(permited_errors[0]); i++)
{
if ((status == permited_errors[i].permited_err_code) &&
(strcmp(permited_errors[i].function_name, line) == 0))
error = 0;
}
}
mode = ProTestRunmodeGet();
switch (mode)
{
case TEST_RUN_MODE_STAT:
ProTestStatisticWrite (call, from, status);
break;
case TEST_RUN_MODE_CRASH:
case TEST_RUN_MODE_REPORT:
sprintf(str,"%-37s %-37.37s% -d\n", call, from, status);
ProTestErrlogWrite(str);
if(mode == TEST_RUN_MODE_CRASH && error)
{
printf("\n*** CRASHING Pro/TOOLKIT TEST ***\n");
printf(" Function : %s\n", call);
printf(" Calling function : %s\n", from);
printf(" Status : %d\n", status);
TEST_CRASH()
}
break;
case TEST_RUN_MODE_CRASH_REP:
if (error)
{
/* Report only potential crashes in crash mode*/
sprintf(str,"%-37s %-37.37s% -d\n", call, from, status);
ProTestErrlogWrite(str);
}
}
}
/*====================================================================*\
FUNCTION : ProTestErrlogOpen()
PURPOSE : Open the Error Log file
\*====================================================================*/
int ProTestErrlogOpen(
char *regtest_name, /* Reg test name */
char *proe_vsn, /* Pro/E version */
char *build) /* Pro/E build */
{
int runmode, path_size;
char *dot, *p_env, log_dir[PRO_PATH_SIZE];
time_t t;
char *default_regtest_name = "regtest";
ProError status;
/*--------------------------------------------------------------------*\
Don't open it if the run mode is "silent"
\*--------------------------------------------------------------------*/
runmode = ProTestRunmodeGet();
if(runmode == TEST_RUN_MODE_SILENT)
return(0);
/*--------------------------------------------------------------------*\
Find the directory in which to put the logfile
\*--------------------------------------------------------------------*/
p_env = getenv("PROTOOL_LOG_DIR");
if ( p_env == NULL )
log_dir[0] = '\0';
else
{
strcpy(log_dir, p_env);
path_size = strlen(log_dir);
if ( log_dir[path_size - 1] != '/')
{
log_dir[path_size] = '/';
log_dir[path_size + 1] = '\0';
}
}
printf(" Logfile dir : %s\n", log_dir);
/*--------------------------------------------------------------------*\
Make the name "<regtest>.log" and open the file for write.
\*--------------------------------------------------------------------*/
if( regtest_name == NULL )
regtest_name = default_regtest_name;