# HG changeset patch
# User ZyX <[email protected]>
# Date 1369490537 -14400
# Node ID 3fc0fc7ae6b145f0b0b223a993fb15bc78681ce7
# Parent  eb95fd146cc21c49103af9ff9fcb250827b83ba4
Rename DICTKEY_GET_NOTEMPTY to DICTKEY_GET

DICTKEY_GET was not used anywhere

diff -r eb95fd146cc2 -r 3fc0fc7ae6b1 src/if_py_both.h
--- a/src/if_py_both.h  Sat May 25 17:59:00 2013 +0400
+++ b/src/if_py_both.h  Sat May 25 18:02:17 2013 +0400
@@ -34,7 +34,12 @@
     PyObject   *dictkey_todecref;
 #define DICTKEY_GET(err) \
     if (!(key = StringToChars(keyObject, &dictkey_todecref))) \
-       return err;
+       return err; \
+    if (*key == NUL) \
+    { \
+       PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
+       return err; \
+    }
 #define DICTKEY_UNREF \
     Py_XDECREF(dictkey_todecref);
 
@@ -851,14 +856,6 @@
 
 static PyTypeObject DictionaryType;
 
-#define DICTKEY_GET_NOTEMPTY(err) \
-    DICTKEY_GET(err) \
-    if (*key == NUL) \
-    { \
-       PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
-       return err; \
-    }
-
 typedef struct
 {
     PyObject_HEAD
@@ -950,7 +947,7 @@
     dictitem_T *di;
     DICTKEY_DECL
 
-    DICTKEY_GET_NOTEMPTY(NULL)
+    DICTKEY_GET(NULL)
 
     di = dict_find(self->dict, key, -1);
 
@@ -980,7 +977,7 @@
        return -1;
     }
 
-    DICTKEY_GET_NOTEMPTY(-1)
+    DICTKEY_GET(-1)
 
     di = dict_find(dict, key, -1);
 
@@ -1653,7 +1650,7 @@
     if (self->Check(self->from))
        return NULL;
 
-    DICTKEY_GET_NOTEMPTY(NULL)
+    DICTKEY_GET(NULL)
 
     flags = get_option_value_strict(key, &numval, &stringval,
                                    self->opt_type, self->from);
@@ -1792,7 +1789,7 @@
     if (self->Check(self->from))
        return -1;
 
-    DICTKEY_GET_NOTEMPTY(-1)
+    DICTKEY_GET(-1)
 
     flags = get_option_value_strict(key, NULL, NULL,
                                    self->opt_type, self->from);
@@ -4036,7 +4033,7 @@
        if (valObject == NULL)
            return -1;
 
-       DICTKEY_GET_NOTEMPTY(-1)
+       DICTKEY_GET(-1)
 
        di = dictitem_alloc(key);
 
@@ -4110,7 +4107,7 @@
            return -1;
        }
 
-       DICTKEY_GET_NOTEMPTY(-1)
+       DICTKEY_GET(-1)
 
        valObject = PyTuple_GetItem(litem, 1);
        if (valObject == NULL)

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


*** /tmp/extdiff.FmLRzM/vim.eb95fd146cc2/src/if_py_both.h	2013-05-25 18:37:59.799179306 +0400
--- vim.3fc0fc7ae6b1/src/if_py_both.h	2013-05-25 18:37:59.806175740 +0400
***************
*** 34,40 ****
      PyObject	*dictkey_todecref;
  #define DICTKEY_GET(err) \
      if (!(key = StringToChars(keyObject, &dictkey_todecref))) \
! 	return err;
  #define DICTKEY_UNREF \
      Py_XDECREF(dictkey_todecref);
  
--- 34,45 ----
      PyObject	*dictkey_todecref;
  #define DICTKEY_GET(err) \
      if (!(key = StringToChars(keyObject, &dictkey_todecref))) \
! 	return err; \
!     if (*key == NUL) \
!     { \
! 	PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
! 	return err; \
!     }
  #define DICTKEY_UNREF \
      Py_XDECREF(dictkey_todecref);
  
***************
*** 851,864 ****
  
  static PyTypeObject DictionaryType;
  
- #define DICTKEY_GET_NOTEMPTY(err) \
-     DICTKEY_GET(err) \
-     if (*key == NUL) \
-     { \
- 	PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
- 	return err; \
-     }
- 
  typedef struct
  {
      PyObject_HEAD
--- 856,861 ----
***************
*** 950,956 ****
      dictitem_T	*di;
      DICTKEY_DECL
  
!     DICTKEY_GET_NOTEMPTY(NULL)
  
      di = dict_find(self->dict, key, -1);
  
--- 947,953 ----
      dictitem_T	*di;
      DICTKEY_DECL
  
!     DICTKEY_GET(NULL)
  
      di = dict_find(self->dict, key, -1);
  
***************
*** 980,986 ****
  	return -1;
      }
  
!     DICTKEY_GET_NOTEMPTY(-1)
  
      di = dict_find(dict, key, -1);
  
--- 977,983 ----
  	return -1;
      }
  
!     DICTKEY_GET(-1)
  
      di = dict_find(dict, key, -1);
  
***************
*** 1653,1659 ****
      if (self->Check(self->from))
  	return NULL;
  
!     DICTKEY_GET_NOTEMPTY(NULL)
  
      flags = get_option_value_strict(key, &numval, &stringval,
  				    self->opt_type, self->from);
--- 1650,1656 ----
      if (self->Check(self->from))
  	return NULL;
  
!     DICTKEY_GET(NULL)
  
      flags = get_option_value_strict(key, &numval, &stringval,
  				    self->opt_type, self->from);
***************
*** 1792,1798 ****
      if (self->Check(self->from))
  	return -1;
  
!     DICTKEY_GET_NOTEMPTY(-1)
  
      flags = get_option_value_strict(key, NULL, NULL,
  				    self->opt_type, self->from);
--- 1789,1795 ----
      if (self->Check(self->from))
  	return -1;
  
!     DICTKEY_GET(-1)
  
      flags = get_option_value_strict(key, NULL, NULL,
  				    self->opt_type, self->from);
***************
*** 4036,4042 ****
  	if (valObject == NULL)
  	    return -1;
  
! 	DICTKEY_GET_NOTEMPTY(-1)
  
  	di = dictitem_alloc(key);
  
--- 4033,4039 ----
  	if (valObject == NULL)
  	    return -1;
  
! 	DICTKEY_GET(-1)
  
  	di = dictitem_alloc(key);
  
***************
*** 4110,4116 ****
  	    return -1;
  	}
  
! 	DICTKEY_GET_NOTEMPTY(-1)
  
  	valObject = PyTuple_GetItem(litem, 1);
  	if (valObject == NULL)
--- 4107,4113 ----
  	    return -1;
  	}
  
! 	DICTKEY_GET(-1)
  
  	valObject = PyTuple_GetItem(litem, 1);
  	if (valObject == NULL)

Raspunde prin e-mail lui