Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    optimize

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 664 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 13/01/2008 at 23:05, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi!
      Is it a C++ subtlety which I will never understand or is it really
      a compiler fault (Microsoft C++ 6.0) ?
      the following code works fine, but delivers garbage if
      speed-optimized.Whats wrong?
         //------------------------------
         Filename make_Filename(Filename path , String name , String suff )
         {
           Filename p  = path;
           Filename n  = Filename(name);
           Filename pn = p + n;
           pn.SetSuffix(suff);
           return(pn);
         };
         //------------------------------
         ...........
           BaseFile *bf = BaseFile::Alloc();
           Filename filnam;
                    filnam = make_Filename(GeGetPluginPath() , String("test") , String("txt"));
        
                         ---> c:\maxon....\myplugdir est.txt == ok
         speedoptimized  ---> c:\maxon....\myplugdir\.        == 😞
        
           bf->Open(filnam, GE_READ , FILE_DIALOG ,GE_INTEL);
         .....
         //------------------------------
      Can someone help?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 14/01/2008 at 00:39, xxxxxxxx wrote:

        The backslash '' is used for such things as '\n' you need to use two '\' to get a single character as a backslash.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 14/01/2008 at 07:18, xxxxxxxx wrote:

          the "" part of the message denotes the two different results of
          a) compiled without optimiziation
          b) *with* optimization

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 14/01/2008 at 08:45, xxxxxxxx wrote:

            You should use Filename.SetFile() instead of '+' (it's more reliable). Also, I've found that there is no real equivalence for '=' with Filename. Better to do it like this:

            > Filename p = Filename(path);
            > p.SetFile(name);
            > p.SetSuffix(suff);
            > return (p);

            Not certain what you mean by 'speed-optimized'? The default SDK project build settings specify "Maximize Speed" for optimizations.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 14/01/2008 at 21:47, xxxxxxxx wrote:

              Hi.
              Of course "Maximize Speed.
              I wanted to know, if its my fault (as usual) or if the
              compiler did something wrong.
              unfortunately the function
                 Filename make_Filename(Filename path , String name , String suff )
              seems to work correctly. Its the call which does something,
              but I cannot find out whats wrong. Its all a little bit
              worrying, because I have not the slightest idea what to do
              (or not to do).

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 14/01/2008 at 22:47, xxxxxxxx wrote:

                For which version of C4D is this being built - which SDK?

                I've never experienced a problem like that. This can sometimes be unexpected code problems elsewhere seeping into seemingly good code (e.g.: memory corruption).

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 15/01/2008 at 00:43, xxxxxxxx wrote:

                  Hi.
                   c4d 9.6
                   sdk 8.5
                   I dont believe that this has any importance.
                   Memory corruption? No, I dont think so. Maybe an unfortunate
                  compiler settings. I think I will compare with the originals.
                  I *have* expererienced different behaviour of optimzed/not optimuzed
                  programmes but that was my own fault.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 15/01/2008 at 05:08, xxxxxxxx wrote:

                    Sorry, must have been having a dumb moment...

                    Have you tried passing them as local variables to see if it makes any difference,e.g.

                    > _
                    > String test_str="Test",txt_str="Txt";
                    >
                    > filnam = make_Filename(GeGetPluginPath(), test_str,txt_str);
                    > _

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 16/01/2008 at 01:23, xxxxxxxx wrote:

                      HI!
                        --> Have you tried passing them as local variables
                      Now I have. No difference.
                      But I think its really a compiler error.
                      As far as I cannot understand that kind of stuff, the compiler
                      forgets to reserve memory for the result of GeGetPluginPath()
                      on the stack. So the other parameters are overridden and
                      this could well explain the results.
                      Now I use : Filename localvar = GeGetPluginPath(). ... and so on.
                      and its working now.
                      ...until the next next time of course.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post