File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2165,11 +2165,21 @@ static PyObject *WinObj_getattr(self, name)
21652165
21662166#define WinObj_setattr NULL
21672167
2168- #define WinObj_compare NULL
2168+ static int WinObj_compare (self , other )
2169+ WindowObject * self , * other ;
2170+ {
2171+ if ( self -> ob_itself > other -> ob_itself ) return 1 ;
2172+ if ( self -> ob_itself < other -> ob_itself ) return -1 ;
2173+ return 0 ;
2174+ }
21692175
21702176#define WinObj_repr NULL
21712177
2172- #define WinObj_hash NULL
2178+ static int WinObj_hash (self )
2179+ WindowObject * self ;
2180+ {
2181+ return (int )self -> ob_itself ;
2182+ }
21732183
21742184PyTypeObject Window_Type = {
21752185 PyObject_HEAD_INIT (& PyType_Type )
Original file line number Diff line number Diff line change @@ -126,6 +126,29 @@ def outputCleanupStructMembers(self):
126126 OutRbrace ()
127127 Output ("self->ob_itself = NULL;" )
128128 Output ("self->ob_freeit = NULL;" )
129+
130+ def outputCompare (self ):
131+ Output ()
132+ Output ("static int %s_compare(self, other)" , self .prefix )
133+ IndentLevel ()
134+ Output ("%s *self, *other;" , self .objecttype )
135+ DedentLevel ()
136+ OutLbrace ()
137+ Output ("if ( self->ob_itself > other->ob_itself ) return 1;" )
138+ Output ("if ( self->ob_itself < other->ob_itself ) return -1;" )
139+ Output ("return 0;" )
140+ OutRbrace ()
141+
142+ def outputHash (self ):
143+ Output ()
144+ Output ("static int %s_hash(self)" , self .prefix )
145+ IndentLevel ()
146+ Output ("%s *self;" , self .objecttype )
147+ DedentLevel ()
148+ OutLbrace ()
149+ Output ("return (int)self->ob_itself;" )
150+ OutRbrace ()
151+
129152## def outputFreeIt(self, itselfname):
130153## Output("DisposeWindow(%s);", itselfname)
131154# From here on it's basically all boiler plate...
You can’t perform that action at this time.
0 commit comments