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

Re: [PATCH] Refactoring

Expand Messages
  • ZyX
    Forgot this. Attached patch contains both this and previous change # HG changeset patch # User ZyX # Date 1368961186 -14400 # Branch
    Message 1 of 7 , May 19, 2013
    • 0 Attachment
      Forgot this. Attached patch contains both this and previous change
      # HG changeset patch
      # User ZyX <kp-pav@...>
      # Date 1368961186 -14400
      # Branch python-extended-2
      # Node ID eea6cccdddc53335661cc56d592f1f412adcf0df
      # Parent 5c5d22791c61dc77a3685fe3b5e86c377330ea79
      Also check *New output for errors

      diff -r 5c5d22791c61 -r eea6cccdddc5 src/if_py_both.h
      --- a/src/if_py_both.h Sun May 19 14:47:56 2013 +0400
      +++ b/src/if_py_both.h Sun May 19 14:59:46 2013 +0400
      @@ -4253,6 +4253,14 @@
      if (add_object(m, name, obj)) \
      return -1;

      +#define ADD_CHECKED_OBJECT(m, name, obj) \
      + { \
      + PyObject *value = obj; \
      + if (!value) \
      + return -1; \
      + ADD_OBJECT(m, name, value); \
      + }
      +
      static int
      populate_module(PyObject *m, object_adder add_object)
      {
      @@ -4260,12 +4268,8 @@

      for (i = 0; i < sizeof(numeric_constants) / sizeof(struct numeric_constant);
      ++i)
      - {
      - PyObject *value;
      - if (!(value = PyInt_FromLong(numeric_constants[i].value)))
      - return -1;
      - ADD_OBJECT(m, numeric_constants[i].name, value);
      - }
      + ADD_CHECKED_OBJECT(m, numeric_constants[i].name,
      + PyInt_FromLong(numeric_constants[i].value));

      for (i = 0; i < sizeof(object_constants) / sizeof(struct object_constant);
      ++i)
      @@ -4281,8 +4285,9 @@
      return -1;
      ADD_OBJECT(m, "error", VimError);

      - ADD_OBJECT(m, "vars", DictionaryNew(&globvardict));
      - ADD_OBJECT(m, "vvars", DictionaryNew(&vimvardict));
      - ADD_OBJECT(m, "options", OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL));
      + ADD_CHECKED_OBJECT(m, "vars", DictionaryNew(&globvardict));
      + ADD_CHECKED_OBJECT(m, "vvars", DictionaryNew(&vimvardict));
      + ADD_CHECKED_OBJECT(m, "options",
      + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL));
      return 0;
      }

      --
      --
      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.
    • Bram Moolenaar
      ... Where does this go in the list of patches? Before 0/? or after 5/?? -- Any sufficiently advanced technology is indistinguishable from magic. Arthur C.
      Message 2 of 7 , May 19, 2013
      • 0 Attachment
        ZyX wrote:

        > Forgot this. Attached patch contains both this and previous change
        > # HG changeset patch
        > # User ZyX <kp-pav@...>
        > # Date 1368961186 -14400
        > # Branch python-extended-2
        > # Node ID eea6cccdddc53335661cc56d592f1f412adcf0df
        > # Parent 5c5d22791c61dc77a3685fe3b5e86c377330ea79
        > Also check *New output for errors

        Where does this go in the list of patches? Before 0/? or after 5/??


        --
        Any sufficiently advanced technology is indistinguishable from magic.
        Arthur C. Clarke
        Any sufficiently advanced bug is indistinguishable from a feature.
        Rich Kulawiec

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        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.
      • ZyX
        ... Nowhere: it is already part of (4/?). This list contains *all* unapplied patches. -- -- You received this message from the vim_dev maillist. Do not
        Message 3 of 7 , May 19, 2013
        • 0 Attachment
          > Where does this go in the list of patches? Before 0/? or after 5/??

          Nowhere: it is already part of (4/?). This list contains *all* unapplied patches.

          --
          --
          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.