moved globals from commu.h to .c and used extern. This needed for eiger g++ server compiling. Also typecasted all the mallocs

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@664 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-09-13 07:01:36 +00:00
parent 23bbefd4a2
commit 99b0ea47b0
3 changed files with 13 additions and 15 deletions

View File

@ -9,7 +9,10 @@
#include <errno.h>
#include <sys/time.h>
char lastClientIP[INET_ADDRSTRLEN];
char thisClientIP[INET_ADDRSTRLEN];
int lockStatus;
int differentClients;
//int socketDescriptor, file_des;
const int send_rec_max_size=SEND_REC_MAX_SIZE;
@ -486,7 +489,7 @@ int receiveChip(int file_des, sls_detector_chip* myChip) {
if (chdiff<=0)
ts+=receiveData(file_des,myChip->chanregs, sizeof(int)*nChans,INT32);
else {
ptr=malloc(chdiff*sizeof(int));
ptr=(int*)malloc(chdiff*sizeof(int));
myChip->nchan=nchanold;
ts+=receiveData(file_des,myChip->chanregs, sizeof(int)*nchanold,INT32);
ts+=receiveData(file_des,ptr, sizeof(int)*chdiff,INT32);
@ -584,7 +587,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
#endif
} else {
dacptr=malloc(ndacdiff*sizeof(dacs_t));
dacptr=(dacs_t*)malloc(ndacdiff*sizeof(dacs_t));
myMod->ndac=ndold;
ts+=receiveData(file_des,myMod->dacs, sizeof(dacs_t)*ndold,INT32);
ts+=receiveData(file_des,dacptr, sizeof(dacs_t)*ndacdiff,INT32);
@ -598,7 +601,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
printf("adcs received\n");
#endif
} else {
adcptr=malloc(nadcdiff*sizeof(dacs_t));
adcptr=(dacs_t*)malloc(nadcdiff*sizeof(dacs_t));
myMod->nadc=naold;
ts+=receiveData(file_des,myMod->adcs, sizeof(dacs_t)*naold,INT32);
ts+=receiveData(file_des,adcptr, sizeof(dacs_t)*nadcdiff,INT32);
@ -612,7 +615,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
printf("chips received\n");
#endif
} else {
chipptr=malloc(nchipdiff*sizeof(int));
chipptr=(int*)malloc(nchipdiff*sizeof(int));
myMod->nchip=nchipold;
ts+=receiveData(file_des,myMod->chipregs, sizeof(int)*nchipold,INT32);
ts+=receiveData(file_des,chipptr, sizeof(int)*nchipdiff,INT32);
@ -626,7 +629,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
printf("chans received\n");
#endif
} else {
chanptr=malloc(nchandiff*sizeof(int));
chanptr=(int*)malloc(nchandiff*sizeof(int));
myMod->nchan=nchanold;
ts+=receiveData(file_des,myMod->chanregs, sizeof(int)*nchanold,INT32);
ts+=receiveData(file_des,chanptr, sizeof(int)*nchandiff,INT32);

View File

@ -16,11 +16,6 @@
char lastClientIP[INET_ADDRSTRLEN];
char thisClientIP[INET_ADDRSTRLEN];
int lockStatus;
int differentClients;
typedef enum{
INT16,
INT32,

View File

@ -62,11 +62,10 @@ $Revision$
/** get flag form most functions */
#define GET_FLAG -1
#ifdef __cplusplus
#if defined(__cplusplus) && !defined(EIGERD)
/** @short class containing all the structures, constants and enum definitions */
class slsDetectorDefs {
public:
slsDetectorDefs(){};
@ -565,7 +564,7 @@ enum angleConversionParameter {
//} angleConversionConstant;
#ifdef __cplusplus
#if defined(__cplusplus) && !defined(EIGERD)
protected:
#endif
@ -575,7 +574,8 @@ enum angleConversionParameter {
#include "sls_detector_funcs.h"
#endif
#ifdef __cplusplus
#if defined(__cplusplus) && !defined(EIGERD)
};
#endif
;