Loading ...
Sorry, an error occurred while loading the content.

Re: type of number/float in vim script

Expand Messages
  • Christian Brabandt
    Hi mattn! ... Good idea, if this is possible on all architectures where Vim runs. regards, Christian -- Der Klügere gibt nach, solange, bis er der dumme ist.
    Message 1 of 5 , Dec 26, 2012
    • 0 Attachment
      Hi mattn!

      On Mi, 26 Dez 2012, mattn wrote:

      > Hi, all
      >
      > I'm thinking, type of 'number' in vim script must be 64bit. Also 'float' should be 'double' in 2013/2014 or later.
      > `getfsize()` can't return size of big file over 32bit. And localtime() return 32bit.
      >
      > I suggest to let us convert types in vim script.
      >
      > How do you think?

      Good idea, if this is possible on all architectures where Vim runs.

      regards,
      Christian
      --
      Der Klügere gibt nach, solange, bis er der dumme ist.

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • mattn
      Bram, How about to start implement? At the first, re-define int64_t or _int64 for vimnumber_T? -- -- You received this message from the vim_dev maillist. Do
      Message 2 of 5 , Jan 5, 2014
      • 0 Attachment
        Bram, How about to start implement?
        At the first, re-define int64_t or _int64 for vimnumber_T?

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • mattn
        https://gist.github.com/mattn/8278843 This is in progress. -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below
        Message 3 of 5 , Jan 5, 2014
        • 0 Attachment
          https://gist.github.com/mattn/8278843

          This is in progress.

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Andre Sihera
          - -#if SIZEOF_INT
          Message 4 of 5 , Jan 6, 2014
          • 0 Attachment
            -
            -#if SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
            -typedef long varnumber_T;
            -#else
            -typedef int varnumber_T;
            -#endif
            +typedef int64_t varnumber_T;


            In my opinion, this type of change is not acceptable.

            If VIM is to be targetted for 32-bit platforms, it should have the option to
            run with 32-bit wide types on those platforms for optimal performance.

            64-bit wide types on 32-bit platforms cause 64-bit arithmetic emulation
            to be performed on ALL integer-based calculations, impacting the speed
            of such calculations, be it in-script variable access, loop control, etc.

            The typedef should look like this:

            #if sizeof(size_t) > 4 /* ANSI C only. need to change to cross-standard
            64-bit test */
            typedef int64_t varnumber_T;
            #else
            #if SIZEOF_INT<= 3 /* use long if int is smaller than 32 bits */
            typedef long varnumber_T;
            #else
            typedef int varnumber_T;
            #endif
            #endif


            Use of size_t is the best way in ANSI C to know the width of the system
            bus as size_t must be able to reflect the size of the largest possible
            addressable memory object (as returned by "malloc()").



            On 06/01/14 15:34, mattn wrote:
            > https://gist.github.com/mattn/8278843
            >
            > This is in progress.
            >

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.