Re: [Flightgear-devel] Addition of true comms in multiplayer
Jonathan, On Mon, Sep 03, 2007 at 09:05:59AM -0500, Jonathan Wagner wrote: [...] I probably haven't been following this conversation closely enough, but what about borrowing from the KDE4 projects phonon and decibel. I know phonon will be cross-platform with a Jack, Alsa, GStreamer and DirectSound plugins. Decibel is a communications package which pulls in VoIP and instant messaging all together in one interface. I am pretty sure decibel will be cross-platform as well, though perhaps not in time for the KDE 4.0 release. Their websites are: phonon.kde.org decibel.kde.org Just my 2 cents for what it's worth. Jonathan Thanks for your hints! I wil take a look at both projects but I think libiaxclient will fit for the first testings. The problem may be that SIP is used as VoIP protocol. Most of the users will have NAT gateways and SIP (and H.323) have problems with NAT. So IAX is the only VoIP protocol which is specialized for traversing NAT gateways... but we will see how it works in some days... :-) Regards, Holger -- # ## ## Holger Wirtz Phone : (+49 30) 884299-40 ## ## ## ### ## DFN-Verein Fax : (+49 30) 884299-70 ## ## ## Stresemannstr. 78E-Mail: [EMAIL PROTECTED] ## ## ## ## ### 10963 Berlin # ## ## ## GERMANY WWW : http://www.dfn.de GPG-Fingerprint: ABFA 1F51 DD8D 503C 85DC 0C51 E961 79E2 6685 9BCF - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] formatting in nasal
* SydSandy -- 9/3/2007 3:11 PM: is there a way to format a double and output that to a string property with writing the double to a property first without? - sprintf() m. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Google Earth FlightSimulator
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Someone should contact them and ask them for ways to integrate google earth into flightgear. I tested the google earth flightsim yesterday, the scenery looks very nice in some places but is very bad in others (like around my local airport, ESOE). Also many runways are extremely uneven, much more than realistic. The aircraft doesn't handle very realistically either. /AnMaster Erik Hofman wrote: Hi, It looks like google provides a simple flight simulator with googlemaps: http://marco-za.blogspot.com/2007/08/google-earth-flight-simulator.html Looking at the screenshots it does remind me of an early version of FlightGear (which might or might not be true), but most of the key strokes match flightgear dead on: http://earth.google.com/intl/en/userguide/v4/flightsim/index.html This makes one wonder.. Erik -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG3SAyWmK6ng/aMNkRCruuAJwL1U1HZp9Pi37TBivv/hJNqJkf9gCeMlZW rxL5TjgrKO9pC09Wtv6Q6eg= =Hgqe -END PGP SIGNATURE- - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Google Earth FlightSimulator
Hi all, On Tue, Sep 04, 2007 at 11:07:02AM +0200, AnMaster wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Someone should contact them and ask them for ways to integrate google earth into flightgear. I spoke to Alex Perry from Google at LinuxTag2007 in Berlin. I asked him how FlightGera can use GoogleMaps as scenery. The problem behind is the licensing. They cannot give away the data without restrictions or something like a deal. Here is the last email from Alex: --- cut here --- I enjoyed chatting to you at LinuxTag. Let me know if you come up with a viable model whereby an open source project such as TerraGear could reasonably collaborate with a for-profit corporation such as Google. Bear in mind that there are other similar open source projects out there, as well as other companies with licensed data. Unlike TerraGear, some of the other open source projects are also legally not-for-profit entities and this may assist you in proposing collaboration opportunities. --- cut here --- But perhaps someone on the list has an idea how to work together with Google? Regards, Holger I tested the google earth flightsim yesterday, the scenery looks very nice in some places but is very bad in others (like around my local airport, ESOE). Also many runways are extremely uneven, much more than realistic. The aircraft doesn't handle very realistically either. /AnMaster Erik Hofman wrote: Hi, It looks like google provides a simple flight simulator with googlemaps: http://marco-za.blogspot.com/2007/08/google-earth-flight-simulator.html Looking at the screenshots it does remind me of an early version of FlightGear (which might or might not be true), but most of the key strokes match flightgear dead on: http://earth.google.com/intl/en/userguide/v4/flightsim/index.html This makes one wonder.. Erik -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG3SAyWmK6ng/aMNkRCruuAJwL1U1HZp9Pi37TBivv/hJNqJkf9gCeMlZW rxL5TjgrKO9pC09Wtv6Q6eg= =Hgqe -END PGP SIGNATURE- - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel -- # ## ## Holger Wirtz Phone : (+49 30) 884299-40 ## ## ## ### ## DFN-Verein Fax : (+49 30) 884299-70 ## ## ## Stresemannstr. 78E-Mail: [EMAIL PROTECTED] ## ## ## ## ### 10963 Berlin # ## ## ## GERMANY WWW : http://www.dfn.de GPG-Fingerprint: ABFA 1F51 DD8D 503C 85DC 0C51 E961 79E2 6685 9BCF - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] b1900d livery put-together (was: OSG and material animation, livery change ??)
On 8/31/07, SydSandy [EMAIL PROTECTED] wrote: Oh man I hope you put it back together again ! Ah well, you probably don't want to know to what extend I keep messing with it for unrelated learning, testing and general tweaking around purposes. But that's only because I like it very much. Thanks for your great effort there. So on putting it together for now: considering the latest cvs I gather you want to use the generic livery handling. But perhaps something went wrong with the cvs stuff; the livery describing xmlfiles must live in the directory the aircraft.livery.init specifies. Even more so as the otherwise empty dir won't get created by regular cvs -d -P, thus that call fails and subsequently the rest of systems.nas doesn't get evaluated. Some further trial and error showed that even with my suggested inclusion of texture in the pre-existing material animations these won't work; even when combined into one and using a single changing node specified in texture-prop unless the condition is removed . (Perhaps I should restart digging into the code from there...) So unless needed by something else (plib?) I suggest removing those. I moved some objects I previously wasn't aware of from the prior animations to the new one. For now I kept those, which aren't changed by the two existing liveries, but seem reasonably to be variable. I've attached a patch along those lines, not including the moving/renaming of NZA.xml and CMA.xml to Liveries/. (Unfortunately I wasn't able to direct git to shut up about the newline business) Best regards K. Hoercher diff --git a/Models/b1900d-anim.xml b/Models/b1900d-anim.xml index 0582b92..9df2596 100755 --- a/Models/b1900d-anim.xml +++ b/Models/b1900d-anim.xml @@ -11,12 +11,17 @@ object-nameLHflap/object-name object-nameLHflap1/object-name object-nameRHaileron/object-name + object-nameLHgeardoor1/object-name + object-nameLHgeardoor2/object-name object-nameRHelevator/object-name object-nameRHflap/object-name object-nameRHflap1/object-name object-nameRudder/object-name + object-nameRHgeardoor2/object-name + object-nameRHgeardoor1/object-name object-nameTrim/object-name object-nameWing/object-name + object-namefrtWheeldoor/object-name property-base/sim/model/livery/all/property-base texture-proptexture/texture-prop textureNZAlivery.rgb/texture @@ -670,46 +675,6 @@ /animation animation -typematerial/type -condition -equals -propertysim/model/b1900d/livery-num/property -value0/value -/equals -/condition -object-nameFuselage/object-name -object-nameRudder/object-name -object-nameEngines/object-name -object-nameWing/object-name -object-namefrtWheeldoor/object-name -object-nameRHgeardoor2/object-name -object-nameRHgeardoor1/object-name -object-nameLHgeardoor1/object-name -object-nameLHgeardoor2/object-name -texture-prop/sim/model/b1900d/texture/texture-prop -/animation - -animation -typematerial/type -condition -equals -propertysim/model/b1900d/livery-num/property -value1/value -/equals -/condition -object-nameFuselage/object-name -object-nameRudder/object-name -object-nameEngines/object-name -object-nameWing/object-name -object-namefrtWheeldoor/object-name -object-nameRHgeardoor2/object-name -object-nameRHgeardoor1/object-name -object-nameLHgeardoor1/object-name -object-nameLHgeardoor2/object-name -texture-prop/sim/model/b1900d/texture[1]/texture-prop -/animation - -animation typeselect/type object-namepilot/object-name condition @@ -2817,4 +2782,4 @@ /axis /animation -/PropertyList \ No newline at end of file +/PropertyList diff --git a/b1900d-base.xml b/b1900d-base.xml index 9bf4796..b9fa8d9 100644 --- a/b1900d-base.xml +++ b/b1900d-base.xml @@ -32,9 +32,6 @@ July 2004 Syd Adams model pathAircraft/b1900d/Models/b1900d-anim.xml/path b1900d -texture n=0NZAlivery.rgb/texture -texture n=1CMAlivery.rgb/texture -livery-num type=int0/livery-num wiper type=booltrue/wiper material instruments @@ -220,4 +217,4 @@ July 2004 Syd Adams /systems /nasal -/PropertyList \ No newline at end of file +/PropertyList - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ Flightgear-devel
Re: [Flightgear-devel] Google Earth FlightSimulator
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Holger Wirtz wrote: Hi all, On Tue, Sep 04, 2007 at 11:07:02AM +0200, AnMaster wrote: Someone should contact them and ask them for ways to integrate google earth into flightgear. I spoke to Alex Perry from Google at LinuxTag2007 in Berlin. I asked him how FlightGera can use GoogleMaps as scenery. The problem behind is the licensing. They cannot give away the data without restrictions or something like a deal. Here is the last email from Alex: --- cut here --- I enjoyed chatting to you at LinuxTag. Let me know if you come up with a viable model whereby an open source project such as TerraGear could reasonably collaborate with a for-profit corporation such as Google. Bear in mind that there are other similar open source projects out there, as well as other companies with licensed data. Unlike TerraGear, some of the other open source projects are also legally not-for-profit entities and this may assist you in proposing collaboration opportunities. --- cut here --- But perhaps someone on the list has an idea how to work together with Google? What about providing hooks for google earth to integrate into flightgear instead of the other way around? I'm not a lawyer but couldn't that solve the issues? So google earth does the rendering and only uses flightgear for the FDM, MP and such. /AnMaster Regards, Holger I tested the google earth flightsim yesterday, the scenery looks very nice in some places but is very bad in others (like around my local airport, ESOE). Also many runways are extremely uneven, much more than realistic. The aircraft doesn't handle very realistically either. /AnMaster -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG3UFpWmK6ng/aMNkRCkVyAKCaGdeQfFfRdrlB/h71m+6W3jvKSQCgodsC 3t1DdRARpUt3hjfgWE0ONRs= =F8WK -END PGP SIGNATURE- - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Google Earth FlightSimulator
Hello AnMaster, Last year I did a integration between FlightGear and a autonomous navigation system made by my enterprise to a research institute in Brazil and another team of project did a module to integrate the navigation system information (based on FlightGear's information) with Google Earth and seems to work very fine. The basic idea is create (and update) a XML file, into specific Google Earth directory, and this file contains specific tags that Goggle earth read and execute the commands described by each tag. Google earth read this file in specific time interval, then you can update this file with same time rate of Google earth is waiting for. Try search a information about this on Google earth website. Leidson Campos PlanetaMessenger.org On 9/4/07, AnMaster [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Someone should contact them and ask them for ways to integrate google earth into flightgear. I tested the google earth flightsim yesterday, the scenery looks very nice in some places but is very bad in others (like around my local airport, ESOE). Also many runways are extremely uneven, much more than realistic. The aircraft doesn't handle very realistically either. /AnMaster Erik Hofman wrote: Hi, It looks like google provides a simple flight simulator with googlemaps: http://marco-za.blogspot.com/2007/08/google-earth-flight-simulator.html Looking at the screenshots it does remind me of an early version of FlightGear (which might or might not be true), but most of the key strokes match flightgear dead on: http://earth.google.com/intl/en/userguide/v4/flightsim/index.html This makes one wonder.. Erik -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG3SAyWmK6ng/aMNkRCruuAJwL1U1HZp9Pi37TBivv/hJNqJkf9gCeMlZW rxL5TjgrKO9pC09Wtv6Q6eg= =Hgqe -END PGP SIGNATURE- - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Google Earth FlightSimulator
Last year I did a integration between FlightGear and a autonomous navigation system made by my enterprise to a research institute in Brazil and another team of project did a module to integrate the navigation system information (based on FlightGear's information) with Google Earth and seems to work very fine. The basic idea is create (and update) a XML file, into specific Google Earth directory, and this file contains specific tags that Goggle earth read and execute the commands described by each tag. Google earth read this file in specific time interval, then you can update this file with same time rate of Google earth is waiting for. Try search a information about this on Google earth website. I played with FG and GE a while ago: http://pigeond.net/blog.html?cat=flightgearcomments=fgge The major problem was that with GE it only updates at quickest once every one second (typical GPS update rate I was told), no matter what you do. And the second thing is getting GE to follow the plane nicely. Though these were a few GE versions back, and I haven't looked at it since. Pigeon. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Addition of true comms in multiplayer
On 9/3/07, Holger Wirtz [EMAIL PROTECTED] wrote: On Mon, Sep 03, 2007 at 09:07:09AM -0600, Hans Fugal wrote: libiaxclient may even work in Windows with PortAudio, though it might take some effort. Everyone on the list told me to produce something portable and it took some time to find somethin which is portable. I think for the current stae and development of the program I had done the right decissions. It may not work out of the box on Windows or OSX but the base for porting to non-linux is given. Sounds like you've done your homework. I think the easiest approach, after some thought, would be to drive an Asterisk instance with the Asterisk manager API. This isn't very cross-platform, though. You *could* run Asterisk in Windows on a virtual machine, or various other workarounds, but nothing user-friendly comes to mind. I think that noone needs to run an Asterisk server if he is using a client. For the first time I can run the server and if it will be used to much we have to think about setting up one at another location. The server is something specialized and not for the normal user. Right, in your setup we just need one asterisk server. I was just brainstorming; one could use asterisk as the client via the manager API, but that would mean each user needs asterisk and perhaps some softphone. I think that might have been easier than coding up a client with libiaxclient, but much more hassle for the users. -- Hans Fugal Fugal Computing - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
John Denker wrote: 2) It seems vacuous to compare writing via a const char* to writing via a non-const char*, because AFAIK there is no such thing as writing via a const char*. No compiler AFAIK will generate any CPU instructions for it. Oh, good grief: $ echo 'void foo(const char* p){*(char*)p=0;}' tmp.c $ gcc -S -c -o - tmp.c Look! Instructions! I await your further pedantry about this not really being a const pointer because of the cast, to which I will reply that casts like this are precicely the subject of discussion (hint: see olaf's patch)... If it really concerns you, take it to plib-devel. It's not our code. The question was whether the constness issues in the released plib code are blocking bugs for a new FlightGear release. As far as I can see, they are not. Plib's behavior in the lines touched by this patch is platform independent. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Csaba Halász wrote: Note that literal string constants may be allocated in read-only data section, thus causing segmentation fault at runtime. Try calling your foo function passing a literal string, What does this have to do with the discussion? We are talking about const pointers, not linker segments. And in any case I already mentioned (and dismissed) this possibility. From three posts above: I wrote: Are you maybe trying to say that plib is writing to a static string constant? That would be a pretty serious bug if true, but as far as I can see it's not. This flame war might be a whole lot more productive if people would stop trying to show off about their C knowledge and trying harder to figure out what the appropriate way to get plib to build under MSVC is... Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Quoting Andy Ross : The confusion seems to be that Microsoft declared strchr() as taking and returning a const pointer. Which is broken, because strchr() returns a pointer into the *same* memory it got. The constness needs to be synchronized between the pointers, which is outside the capabilities of the C language. So programmers have to choose between a slightly unsafe function that drops const and one that requires a cast to use with a non-const string. No, the confusion seems to come from the difference between standard C runtime and standard C++ runtime. MSVC8 wants to conform to the latter when compiling C++ code. Look at that page : http://www.cplusplus.com/reference/clibrary/cstring/strrchr.html In C++, we now have : const char *strrchr( const char *, int ); char *strrchr( char *, int ); that preserve constness and in C : char *strrchr( const char *, int ); that drop constness a const_cast ( or simply a cast ) wouldn't make the code worse than it is now. -Fred -- Frédéric Bouvier http://frfoto.free.fr Photo gallery - album photo http://www.fotolia.fr/p/2278/partner/2278 Other photo gallery http://fgsd.sourceforge.net/ FlightGear Scenery Designer - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] formatting in nasal
On Tue, 04 Sep 2007 10:03:55 +0200 Melchior FRANZ [EMAIL PROTECTED] wrote: * SydSandy -- 9/3/2007 3:11 PM: is there a way to format a double and output that to a string property with writing the double to a property first without? - sprintf() m. yes , without ;) thanks m , I didnt know nasal used sprintf -- SydSandy [EMAIL PROTECTED] - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
On 9/4/07, Andy Ross [EMAIL PROTECTED] wrote: And in any case I already mentioned (and dismissed) this possibility. From three posts above: Oops, missed that. Sorry. -- Csaba - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
On 9/4/07, Andy Ross [EMAIL PROTECTED] wrote: John Denker wrote: 2) It seems vacuous to compare writing via a const char* to writing via a non-const char*, because AFAIK there is no such thing as writing via a const char*. No compiler AFAIK will generate any CPU instructions for it. Oh, good grief: $ echo 'void foo(const char* p){*(char*)p=0;}' tmp.c $ gcc -S -c -o - tmp.c Look! Instructions! I could be wrong, but I think you missed his point. I don't think he was arguing that you couldn't cast a const char* to a char*. The argument was that without the cast it doesn't work, and the cast is bad form and leads to bugs. I think it's a reasonable argument, not one that needs derision. -- Hans Fugal Fugal Computing - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
On 09/04/2007 09:47 AM, Andy Ross wrote: the patch I assume we are still talking about: http://sourceforge.net/tracker/index.php?func=detailaid=1584727group_id=382atid=100382 strchr() returns a pointer into the *same* memory it got. The constness needs to be synchronized between the pointers, which is outside the capabilities of the C language. It is not outside the capabilities of the c++ language ... which is the language of the patch. The capability is demonstrated in the example below. The whole line of argument is pointless anyway, because the constness is a property of the pointer, not a property of the memory. So programmers have to choose between a slightly unsafe function that drops const and one that requires a cast to use with a non-const string. No, in general they don't need to choose, as explained below. Returning to the higher-level discussion, it is not necessary to do a strdup in this situation, as the following constructive suggestion illustrates. using namespace std; #include iostream const char* strchr(const char* foo){ cout const endl; return foo+3; } char* strchr(char* foo){ cout not const, implemented in terms of: ; const char* bar(foo); return foo + (strchr(bar) - foo); } int main(){ char aa[100]; const char* xx(aa); const char* yy(aa); yy = strchr(xx); // const yy = strchr(aa); // non const } The output of this program is: const not const, implemented in terms of: const Notes: 1) The trick of foo+(bar-foo) is a standard way of transferring information from a const pointer (bar) to a non-const pointer (foo). 2) I chose to embody this trick in a wrapper function, partly to make it easier to insert the explanatory messages. It would be well within the reasonable envelope to put the foo+(bar-foo) trick inline, with no wrapper. == Oh, good grief: $ echo 'void foo(const char* p){*(char*)p=0;}' tmp.c $ gcc -S -c -o - tmp.c Good grief yourself. Do you really think I don't know that ... especially given that I explicitly mentioned it a few lines farther down? - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] formatting in nasal
SydSandy wrote: Hi all , is there a way to format a double and output that to a string property with writing the double to a property first . Should be doable but it escapes me at the moment ... Example : (double) 2.30 to (string) 2:30 Nasal numbers will convert directly to strings according to fairly standard representations. Just use them directly, no conversion is neccessary: var val = 2.3; var msg = The value of 'val' is: ~ val; If you need fancy formatting, like for example limiting the output precision, there is a sprintf() function available that works just like the ANSI one: var msg = sprintf(The value of 'val' is: %.2f, val); I'm not sure if the colon in 2:30 is a typo or not, but that's possible too with a bit of work: var frac = math.mod(val, 1); sprintf(Formatted: %d:%2.2d, val-frac, 100*frac); Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hans Fugal wrote: I could be wrong, but I think you missed his point. I don't think he was arguing that you couldn't cast a const char* to a char*. The argument was that without the cast it doesn't work, and the cast is bad form and leads to bugs. A point, you will note, I never disagreed with. Nonetheless we use plib. And plib's code has bad form and even the occasional bug. Since we use it, we need to build it. It was remarked at the top of this thread that plib 1.8.4 required a patch to build. I noted first that the patch seemed unnecessary (and only later noticed it was wrong), and suggested that the problem (in plib's code, not ours) could be fixed via adjustment of the warning level of the compiler instead. At which point all you guys in the peanut gallery jumped on me about bad form and I started swinging back. I think it's a reasonable argument, not one that needs derision. It is not a reasonable argument in this context, as it involves source code we don't control. And I'd argue the derision started in John's message, for what it's worth, but I suppose that's an issue of taste. The goal here, I will point out yet again, isn't to decide how best to develop plib, but to decide how best to get it built under windows for a FlightGear release. I'd argue that building our released version against an inconsistent library dependency constitutes significantly *worse* form than tolerating some const-incorrectness that has already been vetted out on other platforms. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] formatting in nasal
On Tue, 04 Sep 2007 09:10:02 -0700 Andy Ross [EMAIL PROTECTED] wrote: SydSandy wrote: Hi all , is there a way to format a double and output that to a string property with writing the double to a property first . Should be doable but it escapes me at the moment ... Example : (double) 2.30 to (string) 2:30 Nasal numbers will convert directly to strings according to fairly standard representations. Just use them directly, no conversion is neccessary: var val = 2.3; var msg = The value of 'val' is: ~ val; If you need fancy formatting, like for example limiting the output precision, there is a sprintf() function available that works just like the ANSI one: var msg = sprintf(The value of 'val' is: %.2f, val); I'm not sure if the colon in 2:30 is a typo or not, but that's possible too with a bit of work: var frac = math.mod(val, 1); sprintf(Formatted: %d:%2.2d, val-frac, 100*frac); Andy Thanks Andy , No its not a typo , I want a single string property to hold groundspeed ,TTG and ET , depending on which mode is selected for display on the Primus PFD I didn't know about the sprintf in nasal , sounds perfect for the job :) Cheers -- SydSandy [EMAIL PROTECTED] - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] b1900d livery put-together (was: OSG and material animation, livery change ??)
On Tue, 4 Sep 2007 13:13:04 +0200 K. Hoercher [EMAIL PROTECTED] wrote: On 8/31/07, SydSandy [EMAIL PROTECTED] wrote: Oh man I hope you put it back together again ! Ah well, you probably don't want to know to what extend I keep messing with it for unrelated learning, testing and general tweaking around purposes. But that's only because I like it very much. Thanks for your great effort there. So on putting it together for now: considering the latest cvs I gather you want to use the generic livery handling. But perhaps something went wrong with the cvs stuff; the livery describing xmlfiles must live in the directory the aircraft.livery.init specifies. Even more so as the otherwise empty dir won't get created by regular cvs -d -P, thus that call fails and subsequently the rest of systems.nas doesn't get evaluated. Some further trial and error showed that even with my suggested inclusion of texture in the pre-existing material animations these won't work; even when combined into one and using a single changing node specified in texture-prop unless the condition is removed . (Perhaps I should restart digging into the code from there...) So unless needed by something else (plib?) I suggest removing those. I moved some objects I previously wasn't aware of from the prior animations to the new one. For now I kept those, which aren't changed by the two existing liveries, but seem reasonably to be variable. I've attached a patch along those lines, not including the moving/renaming of NZA.xml and CMA.xml to Liveries/. (Unfortunately I wasn't able to direct git to shut up about the newline business) Best regards K. Hoercher Hi , the left over liveries were my screw up , Ive already removed them here , I'll fix that tonight , and check your new patch. Ideally I'd like the separate liveries to show up online , so everyone isn't flying the same one But I never seem to have time to really dig into it ... But thanks again for your help :) Cheers -- SydSandy [EMAIL PROTECTED] - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] formatting in nasal
SydSandy wrote: No its not a typo , I want a single string property to hold groundspeed ,TTG and ET , depending on which mode is selected for display on the Primus PFD OK. You might want to make that property a string, though, or at least an integer. Storing a fracional number there and extracting things via math is going to cause precision glitches. As it happens, your example is affected by this: 2.3 is not exactly representable as an IEEE double. So you can get different results depending on code path. My example of multiplying it 100 actually doesn't work, because 100*2.3 comes out as 229.9. But if you really do have more than one value, don't be afraid of putting them into separate property nodes. They're cheap. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hi, No, the confusion seems to come from the difference between standard C runtime and standard C++ runtime. MSVC8 wants to conform to the latter when compiling C++ code. Look at that page : Thanks. As a side note: The gcc does not enforce const-correctness very much. The SUN Compilers are very picky about constness. One can notice that some const workarounds in plib SVN are now ifdef SUN Studio. Unfortunatly they still miss MSVC8. Olaf - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hi, I wrote: Plib's behavior in the lines touched by this patch is platform independent. And this bit of the patch is just flat wrong. The original version finds the first _ in the string and nul-terminates it at that location. The fixed code it a complete no-op. - char *p = strrchr(fname,'_'); + char *dupfname = strdup( fname); + char *p = strrchr( dupfname,'_'); if (p != 0) { *p = '\0'; Ahem. You should read the original context... (a little bit polished) bool ssgLoadMDLTexture ( const char *fname, ssgTextureInfo* info ) { FILE *tfile; int index = 0; if ( (tfile = fopen(fname, rb)) == NULL) { char *p = strrchr( (char *)fname,'_'); if (p != 0) { *p = '\0'; p++; index = atoi (p); } Think about calling `ssgLoadTexture(myfile.0af_100, info);' On many systems the string myfile.0af_100 will be placed into the TEXT segment, R/O memory. Please do not mix the terms compiles o.k. and works for me with the code is correct. The patch I supplied fixes this -- more or less esoteric bug condition -- and secondly cleans up a few ugly code part with uneccesarly conditional compilation. And as a side effect it compiles cleanly on MSVC8 (and many others, i hope). Thanks for listening, Olaf - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
olaf flebbe wrote: As a side note: The gcc does not enforce const-correctness very much. Sigh, and the flames continue... Your basis for that statement is what, exactly? Of course gcc enforces const correctness. I suspect what's happening here is that plib, which is using string.h and not string, is getting the C implementation declared. I'm not sure where the C++ standard requires here. Arbitrary libc headers obviously need to pass through compatibly, but maybe there are special requirements for the ANSI headers. Unfortunatly they still miss MSVC8. Is the problem simply that VC8 has trouble? Isn't the obvious solution then to build with VC7 instead? If my memory serves, VC8 shipped with a new runtime that won't work on XP without an update, right? We probably want to build with the compatible compiler anyway. Regardless, you need to fix that patch if you want to see it used. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hi, thanks John! --- Returning to the higher-level discussion, it is not necessary to do a strdup in this situation, as the following constructive suggestion illustrates. ... Johns nice example ... int main(){ char aa[100]; const char* xx(aa); const char* yy; yy = strchr(xx); // const yy = strchr(aa); // non const } o.k. so far, but the job that has to be done is to use the derefenced pointer returned by strchr() as an LVAL. (In order to split filename and an integer) int main(){ char aa[100]; const char* xx(aa); char* yy; yy = strchr(xx); // oops, not const *yy = 0; // Yeah } IMHO one needs strdup here. Olaf - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
olaf flebbe wrote: Please do not mix the terms compiles o.k. and works for me with the code is correct. I did no such thing. The issue here is whether or not the code is the *same* as the one we are shipping on other platforms. Yours is not, and therefore really shouldn't be packaged up into a release. But you're absolutely right: this looks like a plib bug to me too. You should re-submit that fix to the plib folks, not us. (And not as a MSVC8 build patch -- I wasn't looking for bugs in it, for example, and missed this one entirely). We can't fix plib bugs here, and if this isn't a showstopper for the release (it's not) posting it to a thread titled The Release and demanding that it be applied is probably going to confuse things more than help. And I still think that flightgear-devel is an inappropriate forum for discussion plib problems. Our goal here should be to get it building for the release, only. Note that all of this code has *already* been obsoleted in the CVS trunk anyway. After this release, it simply isn't possible for us to hit this bug, or any other problem with ssg, ever again. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hi, If my memory serves, VC8 shipped with a new runtime that won't work on XP without an update, right? Wrong. Regardless, you need to fix that patch if you want to see it used. Yes, I would have to update to current SVN. But I am getting tired of fixing non-gcc bugs. Olaf - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
olaf flebbe wrote: If my memory serves, VC8 shipped with a new runtime that won't work on XP without an update, right? Wrong. Can you elaborate? I'm all but certain that default builds want to link against MSVCR80.DLL (or whatever) at runtime, no? Are we set up to install that in our distributables? Is such an arrangement GPL compatible? I know other projects have had to deal with this issue, but don't know the details. It does strike me as simpler to just use the older compiler. Andy - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] The Release
Hi, If my memory serves, VC8 shipped with a new runtime that won't work on XP without an update, right? Wrong. Can you elaborate? I'm all but certain that default builds want to link against MSVCR80.DLL (or whatever) at runtime, no? One possibility: link statically. Are we set up to install that in our distributables? We have to supply these along with distributables. Either use a redistributable installer or install it as a SxS assembly. (Write a manifest and put it in a properly named subfolder). Is such an arrangement GPL compatible? Yes. See Clause 2: ... If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works I know other projects have had to deal with this issue, but don't know the details. It does strike me as simpler to just use the older compiler. MSVCRT71.dll isn't supplied by WIndows XP (even SP2) either. Please try yourself with a fresh windows XP without drivers. Olaf - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel