| |
|
|
- Página 1 - |
|
 | ¡Hola, irgendwie packe Yo con el Zeiger no de C++(Dev C++). Lo kommt hier el Valor 0 fuera, eigentlich Yo quería 45 haben.
Wer sabe se como de con el Fehler, el I, con el Zeiger gemacht habe?
mfg peter KompilierenMarcaSeparación |
|
|
|
|
| |
|
- Página 2 - |
|
 | Und ni For-Bucle en C++. Hui, el va de, 10x 10.000.000.
Kann Yo kaum glauben, bestätige el Por favor, veces. Yo habe 180ms. Sebastian kannste el veces Testen, no el el Variable con 10.000.000 falso durchlaufen se.
mfg peter KompilierenMarcaSeparación |
|
|
| |
|
|
|
 | long *pL = (long*)PVAR(ram#);
Der Befehl va no .
mfg peter |
|
|
| |
|
|
|
 | Seguro el No long pL = (long*)PVAR(ram#) media? Hab kein prf2cpp a Hand... |
|
|
| |
|
|
|
 | Hab kein prf2cpp a Hand...
Pero Tiempo, el lo en dir standard se esta Wunderwaffe ala C++ con Profano2ccp.
mfg peter |
|
|
| |
|
|
|
 | long pL = (long*)PVAR(ram#)
Compilerfehler..
Tomar esta Variante : char* pL = reinterpret_cast<char*>( adrr);
mfg peter |
|
|
| |
|
|
|
 Sebastian König | Peter Bierbachh
long pL = (long*)PVAR(ram#)
Compilerfehler..
Tomar esta Variante : char* pL = reinterpret_cast<char*>( adrr);
Ok, el reinterpret_cast<>() es en el Tat el sichere Variante, como el Bereichsvariablen en el de Profano2Cpp erzeugten Code primero veces kein Zeigertyp (pero en el Grunde simplemente long) son. Manche Compiler meckern entonces el alten C-Style Cast con (long*) a.
Su Code sieht correcto de . Natürlich se ejecuta el entonces muy rápidamente. Für solche Sachen es Inline-C++ allerdings garnicht notwendig, el el XProfan-Code en efecto después de C++ se traduce. Usted puede para Ejemplo veces dies hier testen: KompilierenMarcaSeparación Wenn Yo el Compiler-Optimierungen (con el TuneMake-Plug-In [...] ) deaktiviere, kann Yo no Geschwindigkeitsunterschied a Deiner Variante con el Inline-Code mehr determinar.
MfG
Sebastian |
|
|
| |
|
|
|
 | Ok, el reinterpret_cast<>() es en el Tat el sichere Variante,
¿Puede du dafür todavía una vez una Ersatz reinstellen, el entonces todos Compiler anerkennen?
mfg peter |
|
|
| |
|
|
|
 | Hier sieht lo anders de. Eingebaut en el Programa como C++ y luego con Profano2cpp : 143ms Dev C++ y 135ms con BCC55 Als normales Programa con Profano2cpp erstellt : 670ms con DEV c++ y 390ms con BCC55
mfg peter KompilierenMarcaSeparacióncls
declare bildxy#,laenge%,test%,z%
dim bildxy#,65000
laenge%=65000
test%=&GetTickCount
whileloop 1,100,1
z%=rgb_farbe_cpp(bildxy#,laenge%)
endwhile
Print Str$(Int(&GetTickCount-test%))
WaitInput
end
proc rgb_farbe_cpp
parameters bildxy#,laenge%
declare r%,g%,b%
whileloop 0,laenge%-1,4
b%=byte(bildxy#,&loop)
g%=byte(bildxy#,&loop+1)
r%=byte(bildxy#,&loop+2)
if (b%>252) | (g%>252) | (r%>252)
z%=255
break
endif
endwhile
ENDPROC
|
|
|
| |
|
|
|
 Sebastian König | Peter Bierbachh
Ok, el reinterpret_cast<>() es en el Tat el sichere Variante,
¿Puede du dafür todavía una vez una Ersatz reinstellen, el entonces todos Compiler anerkennen?
Der reinterpret_cast<>() debería eigentlich de allen Compilern erkannt voluntad - es Teil des Standard-C++ Sprachumfangs.... Was genau funktioniert porque no? Generell gilt, dass uno se en Inline-C++ bastante simplemente a el halten muss, qué el verwendete Compiler unterstützt. Puedo sólo beim Übersetzen des XProfan-Codes sicherstellen, dass el Ergebnis con allen unterstützten Compilern se ejecuta.
Peter Bierbach
Hier sieht lo anders de. Eingebaut en el Programa como C++ y luego con Profano2cpp : 143ms Dev C++ y 135ms con BCC55 Als normales Programa con Profano2cpp erstellt : 670ms con DEV c++ y 390ms con BCC55
Ok, entonces kommt lo wohl auch en el Einzelfall a. Inline-C++ es natürlich praktisch para muy geschwindigkeitskritische Dinge - ähnlich como Inline-ASM en C++. Letzteres ginge de paso auch innerhalb des INLINE_CPP-Blocks, pero yo arbeite a Tiempo auch a uno direkten Unterstützung de Franks XPIA en Profano2Cpp .
MfG
Sebastian |
|
|
| |
|
|
| |
|
- Página 3 - |
|
|
 | Funktioniert ahora alles Prima... 
mfg peter |
|
|
| |
|
|
|
 Sebastian König | Peter Bierbachh
Funktioniert ahora alles Prima...
Super, el freut mich natürlich!  |
|
|
| |
|
|
|
 | Beide Compiler Dev C++ a 4.9.8 y el BCC55 Yo en el Test gehabt. Jetzt ha el BCC55 siempre el Nase vorn gehabt. En Bereichsvariablenüberprüfung/Vergleich a a 3x más rápido. Man se se en el Schleifentest(Whileloop usw) no verlassen. Como war nämlich siempre el DEv C++ más rápido, si aber en el Eingemachte ging war el BCC55 el schnellere.
Posesiones todos mi kritischen Grafikprogramme con Opengl usw, el hier en el Foro a Diskussion waren/son , fehlerfrei übersetzten puede. Un erstaunliche Leistung auch el direkten C++-Code einzusetzen war/es una riesengrosser Erfolg (después de que verstanden hatte).
Profano2cpp es unschlagbar. Zumal lo el bajo anderem guten einfachen C++-Compiler (Dev C++ y BCC55) fehlerfrei einsetzen kann. Wenn entonces el ASM-Routinen con XPIA/XPSE como reinkommen,... 
Für mi ASM-Routinen Yo me una Brücke gebaut. Yo nutze el erstellte DLL de XPIA/XPSE con el Def-Aufruf, kein wesentlicher Aufwand esta reinzusetzen.
mfg peter |
|
|
| |
|
|