File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
examples/extension-hatch/examplePy Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ static PyObject *
55temperature_celsius_to_fahrenheit (PyObject * self , PyObject * args )
66{
77 long celsius ;
8+ long fahrenheit ;
89 PyObject * ret ;
910
1011 if (!PyArg_ParseTuple (args , "l" , & celsius ))
1112 return NULL ;
1213
13- celsius = (celsius * 9 /5 ) + 32 ;
14+ fahrenheit = (celsius * 9 /5 ) + 32 ;
1415
15- ret = PyLong_FromLong (celsius );
16+ ret = PyLong_FromLong (fahrenheit );
1617 Py_INCREF (ret );
1718 return ret ;
1819}
@@ -21,14 +22,15 @@ static PyObject *
2122temperature_fahrenheit_to_celsius (PyObject * self , PyObject * args )
2223{
2324 long fahrenheit ;
25+ long celsius ;
2426 PyObject * ret ;
2527
2628 if (!PyArg_ParseTuple (args , "l" , & fahrenheit ))
2729 return NULL ;
2830
29- fahrenheit = (fahrenheit - 32 ) * 9 /5 ;
31+ celsius = (fahrenheit - 32 ) * 9 /5 ;
3032
31- ret = PyLong_FromLong (fahrenheit );
33+ ret = PyLong_FromLong (celsius );
3234 Py_INCREF (ret );
3335 return ret ;
3436}
You can’t perform that action at this time.
0 commit comments