Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
Richard MacCutchan20-Sep-09 5:10
mveRichard MacCutchan20-Sep-09 5:10 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
includeh1020-Sep-09 5:20
includeh1020-Sep-09 5:20 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
KarstenK21-Sep-09 2:56
mveKarstenK21-Sep-09 2:56 
QuestionDifferent results with debug and release version of simulation program Pin
mass8520-Sep-09 3:37
mass8520-Sep-09 3:37 
AnswerRe: Different results with debug and release version of simulation program Pin
Chris Losinger20-Sep-09 4:08
professionalChris Losinger20-Sep-09 4:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:23
mass8520-Sep-09 4:23 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 4:33
mveRichard MacCutchan20-Sep-09 4:33 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:46
mass8520-Sep-09 4:46 
But do you think I can look for the uninitialized variable within the function part of which I presented here and all objects that are used by this function? Or maybe I should look through whole code?

This is the code of the function:
void BEload::execute(){
	MSDU *msdu = new MSDU();
	msdu->ac = 2;
	msdu->type = DATA;
	msdu->arrivalTime = msdu->staArrivalTime = clock;
	msdu->id = id++;
	double temp = generator.getUpLinkRandom(staAddress);
	t += temp;
	cntr++;
	if (temp < upLinkRatio){
		//packet will be sent from STA to AP
		msdu->DA = 0;
		msdu->TA = msdu->SA = staAddress;
	}else{
		//packet will be sent from AP to STA
		msdu->SA = msdu->TA = 0;
		msdu->DA = staAddress;
	}
	Mac *s = sta[msdu->SA];
	msdu->RA = s->routing[msdu->DA];
	msdu->bitrate = s->bitrate[msdu->RA];
	msdu->size = packetSize;
	if (msdu->size + overhead > s->fragmTSH){ //fragment the frame					
		double fragments = double (msdu->size)/(s->fragmTSH - overhead);
		if (fragments != int(fragments)) fragments = int (fragments + 1);
		msdu->fragments = int(fragments);
		msdu->lastFragmSize = int(msdu->size - (s->fragmTSH - overhead)*(fragments - 1));		
	}else
		msdu->fragments = 1;
	s->bufOUT[2].insertLast(msdu);
		
	time = clock + generator.getTimeBE(staAddress, intensity);
	agenda.schedule(this);
}
double Generator::getUpLinkRandom(int staAddress){
		int x = uniform(coreUpLinkRatio[staAddress]);
		coreUpLinkRatio[staAddress] = x;
		return double(x)/m;
	}

Constructor of MSDU initializes all of MSDU's variables. t, cntr and upLinkRatio are members of BEload and are initialized by BEload's constructor and upLinkRatio is later changed to the value of global upLinkRatio variable (this global variable is not needed anymore, but could it cause any problems? I don't think so.). All variables in Generator class are initialized too.
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 5:00
mveRichard MacCutchan20-Sep-09 5:00 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 5:24
mass8520-Sep-09 5:24 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 7:20
mveRichard MacCutchan20-Sep-09 7:20 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 9:47
mass8520-Sep-09 9:47 
GeneralRe: Different results with debug and release version of simulation program Pin
CPallini20-Sep-09 10:01
mveCPallini20-Sep-09 10:01 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:12
mass8520-Sep-09 10:12 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:08
mveRichard MacCutchan20-Sep-09 10:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:26
mass8520-Sep-09 10:26 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:35
mveRichard MacCutchan20-Sep-09 10:35 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:54
mass8520-Sep-09 10:54 
Question[SOLVED}How to activate a menu [modified] Pin
simion31420-Sep-09 0:31
simion31420-Sep-09 0:31 
AnswerRe: How to activate a menu Pin
GameZelda20-Sep-09 0:58
GameZelda20-Sep-09 0:58 
QuestionBinding a Memo Field Pin
Cal Brass19-Sep-09 14:48
Cal Brass19-Sep-09 14:48 
Question[Message Deleted] Pin
HighCloud19-Sep-09 8:42
HighCloud19-Sep-09 8:42 
AnswerRe: C# Programatic Font Install Pin
«_Superman_»19-Sep-09 20:20
professional«_Superman_»19-Sep-09 20:20 
AnswerRe: C# Programatic Font Install Pin
Code-o-mat19-Sep-09 23:16
Code-o-mat19-Sep-09 23:16 
Questioncan i compile the c programs using commands in coomand prompt undr windows,if possible plz post the procedure Pin
raghava.thummapudi19-Sep-09 7:28
raghava.thummapudi19-Sep-09 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.