Click here to Skip to main content
15,884,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Stefan_Lang20-Jan-14 3:33
Stefan_Lang20-Jan-14 3:33 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 12:46
a_matseevsky20-Jan-14 12:46 
AnswerRe: Bug in Visual Studio 2005 compiler? Pin
jschell17-Jan-14 13:16
jschell17-Jan-14 13:16 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky17-Jan-14 14:33
a_matseevsky17-Jan-14 14:33 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan17-Jan-14 22:24
mveRichard MacCutchan17-Jan-14 22:24 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 0:46
a_matseevsky18-Jan-14 0:46 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan18-Jan-14 1:13
mveRichard MacCutchan18-Jan-14 1:13 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 10:01
a_matseevsky18-Jan-14 10:01 
You cannot help me. How could you help me, if you even do not know, which bytes overwrites fst command? I do not send my procedure only because of its size. And I know now, where the problem is. Well, if you think that the problem is in my code, look at two small pieces and try to understand, why and which one works properly, but the other does not. I fixed the problem (well, not completely- I only rewrote my code, using my knowledge about compiler's incorrect behavior. lrct was removed at all.)

Variant A:
int xmin=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
int xmax=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
h=0.5*pdpr->m_croprect[Left].top+0.5*pdpr->m_croprect[Left].bottom;
pdpr->GetKorrHorz2D(xfirst, xlast, Dv, Dh, h, ddi, yh, yv, yhs, yvs, pKorr, ph, pv);
pdpr->GetCorrLineH2(xfirst, xlast, h, ddi, yh, yv, yh, yv, ph, pv, 0, 0);
yl0=xf+0.5*yh[xf];
yl1=xl+0.5*yh[xl];
yr0=xf+ddi-0.5*yh[xf];
yr1=xl+ddi-0.5*yh[xl];
int xl2=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
if(xl2>xmin)
xmin=xl2;
int xr2=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
if(xmax>xr2)
xmax=xr2;
h=0.1*pdpr->m_croprect[Left].top+0.9*pdpr->m_croprect[Left].bottom;
pdpr->GetKorrHorz2D(xfirst, xlast, Dv, Dh, h, ddi, yh, yv, yhs, yvs, pKorr, ph, pv);
pdpr->GetCorrLineH2(xfirst, xlast, h, ddi, yh, yv, yh, yv, ph, pv, 0, 0);
yl0=xf+0.5*yh[xf];
yl1=xl+0.5*yh[xl];
yr0=xf+ddi-0.5*yh[xf];
yr1=xl+ddi-0.5*yh[xl];
int xl3=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
if(xl3>xmin)
xmin=xl3;
int xr3=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
if(xmax>xr3)
xmax=xr3;
xfirst=xmin+0.02*(xmax-xmin);
xlast=xmax-0.02*(xmax-xmin);

Variant B:

int xl1=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
int xr1=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
h=0.5*pdpr->m_croprect[Left].top+0.5*pdpr->m_croprect[Left].bottom;
pdpr->GetKorrHorz2D(xfirst, xlast, Dv, Dh, h, ddi, yh, yv, yhs, yvs, pKorr, ph, pv);
pdpr->GetCorrLineH2(xfirst, xlast, h, ddi, yh, yv, yh, yv, ph, pv, 0, 0);
yl0=xf+0.5*yh[xf];
yl1=xl+0.5*yh[xl];
yr0=xf+ddi-0.5*yh[xf];
yr1=xl+ddi-0.5*yh[xl];
int xl2=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
int xr2=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
h=0.1*pdpr->m_croprect[Left].top+0.9*pdpr->m_croprect[Left].bottom;
pdpr->GetKorrHorz2D(xfirst, xlast, Dv, Dh, h, ddi, yh, yv, yhs, yvs, pKorr, ph, pv);
pdpr->GetCorrLineH2(xfirst, xlast, h, ddi, yh, yv, yh, yv, ph, pv, 0, 0);
yl0=xf+0.5*yh[xf];
yl1=xl+0.5*yh[xl];
yr0=xf+ddi-0.5*yh[xf];
yr1=xl+ddi-0.5*yh[xl];
int xl3=xf+(fct*pdpr->m_croprect[Right].left-xf-ddi)*(xl-xf)/(yr1-yr0);
int xr3=xl+(fct*pdpr->m_croprect[Left].right-xl)*(xl-xf)/(yl1-yl0);
int xmin=xl1;
int xmax=xr1;
if(xl2>xmin)
xmin=xl2;
if(xl3>xmin)
xmin=xl3;
if(xmax>xr2)
xmax=xr2;
if(xmax>xr3)
xmax=xr3;
xfirst=xmin+0.02*(xmax-xmin);
xlast=xmax-0.02*(xmax-xmin);
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan18-Jan-14 22:13
mveRichard MacCutchan18-Jan-14 22:13 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky19-Jan-14 1:07
a_matseevsky19-Jan-14 1:07 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan19-Jan-14 1:08
mveRichard MacCutchan19-Jan-14 1:08 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky19-Jan-14 10:54
a_matseevsky19-Jan-14 10:54 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
pkfox19-Jan-14 20:20
professionalpkfox19-Jan-14 20:20 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan19-Jan-14 22:21
mveRichard MacCutchan19-Jan-14 22:21 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell18-Jan-14 11:51
jschell18-Jan-14 11:51 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 17:42
a_matseevsky18-Jan-14 17:42 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell20-Jan-14 12:45
jschell20-Jan-14 12:45 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 12:54
a_matseevsky20-Jan-14 12:54 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell23-Jan-14 13:11
jschell23-Jan-14 13:11 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky23-Jan-14 18:00
a_matseevsky23-Jan-14 18:00 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell24-Jan-14 12:17
jschell24-Jan-14 12:17 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky24-Jan-14 16:22
a_matseevsky24-Jan-14 16:22 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell25-Jan-14 12:37
jschell25-Jan-14 12:37 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky25-Jan-14 18:56
a_matseevsky25-Jan-14 18:56 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell26-Jan-14 12:29
jschell26-Jan-14 12:29 

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.