@@ -65,6 +65,10 @@ elements of a tuple. Any other returned elements precede those in the tuple.\
6565 \
6666" ;
6767
68+
69+ // For Windows, we won't want warnings about functions like ctime that we know are OK in the way we use them
70+ #define _CRT_SECURE_NO_WARNINGS
71+
6872#include <time.h>
6973
7074#include <cmqc.h>
@@ -244,7 +248,6 @@ that is empty/not supplied.\
244248static PyObject * ibmmqc_MQLOGCF (PyObject * self , PyObject * args ) {
245249 char * filename = NULL ;
246250 long lOpts ;
247- PyObject * nameObj ;
248251
249252 if (!PyArg_ParseTuple (args , "l|s" , & lOpts ,& filename )) {
250253 return NULL ;
@@ -873,7 +876,7 @@ static PyObject *ibmmqc_MQINQ(PyObject *self, PyObject *args) {
873876 return NULL ;
874877 }
875878
876- selectorCount = PyList_Size (lSelectors );
879+ selectorCount = ( MQLONG ) PyList_Size (lSelectors );
877880
878881 selectors = myAlloc (sizeof (MQLONG ) * selectorCount , "MQINQ" );
879882 if (selectors ) {
@@ -994,6 +997,7 @@ static PyObject *ibmmqc_MQSET(PyObject *self, PyObject *args) {
994997
995998 if (intAttrs ) {
996999 myFree (intAttrs );
1000+
9971001 }
9981002
9991003 if (selectors ) {
@@ -1439,7 +1443,7 @@ static PyObject* ibmmqc_MQSETMP(PyObject *self, PyObject *args) {
14391443 }
14401444 value_length = sizeof (MQINT16 );
14411445 property_value_free = 1 ;
1442- * (PMQINT16 )value = PyLong_AsLong (property_value_object );
1446+ * (PMQINT16 )value = ( MQINT16 ) PyLong_AsLong (property_value_object );
14431447 break ;
14441448
14451449 /* 32-bit integer value */
@@ -1512,10 +1516,10 @@ static PyObject* ibmmqc_MQSETMP(PyObject *self, PyObject *args) {
15121516 pd = (MQPD * )pd_buffer ;
15131517
15141518 name .VSPtr = property_name ;
1515- name .VSLength = property_name_length ;
1519+ name .VSLength = ( MQLONG ) property_name_length ;
15161520
15171521 Py_BEGIN_ALLOW_THREADS
1518- MQSETMP ( (MQHCONN )lQmgrHandle , msg_handle , smpo , & name , pd , property_type , value_length ,
1522+ MQSETMP ( (MQHCONN )lQmgrHandle , msg_handle , smpo , & name , pd , property_type , ( MQLONG ) value_length ,
15191523 value , & compCode , & reasonCode );
15201524 Py_END_ALLOW_THREADS
15211525
@@ -1571,7 +1575,7 @@ static PyObject* ibmmqc_MQINQMP(PyObject *self, PyObject *args) {
15711575
15721576 property_type = (MQLONG )lPropertyType ;
15731577 name .VSPtr = property_name ;
1574- name .VSLength = property_name_length ;
1578+ name .VSLength = ( MQLONG ) property_name_length ;
15751579
15761580 // We know that the property_name is null-terminated because of
15771581 // how Python passes the value. Only ask for the name if a wildcard
@@ -1583,7 +1587,7 @@ static PyObject* ibmmqc_MQINQMP(PyObject *self, PyObject *args) {
15831587 }
15841588 impo -> ReturnedName .VSCCSID = MQCCSI_APPL ;
15851589 impo -> ReturnedName .VSLength = 0 ;
1586- impo -> ReturnedName .VSBufSize = vsbufsize ;
1590+ impo -> ReturnedName .VSBufSize = ( MQLONG ) vsbufsize ;
15871591 }
15881592
15891593 void * value = NULL ;
@@ -1748,7 +1752,7 @@ static PyObject* ibmmqc_MQDLTMP(PyObject *self, PyObject *args) {
17481752 }
17491753
17501754 name .VSPtr = property_name ;
1751- name .VSLength = property_name_length ;
1755+ name .VSLength = ( MQLONG ) property_name_length ;
17521756
17531757 MQDLTMP ((MQHCONN )lQmgrHandle , msg_handle , dmpo , & name , & compCode , & reasonCode );
17541758
@@ -1915,7 +1919,9 @@ PyMODINIT_FUNC PyInit_ibmmqc(void) {
19151919 PyDict_SetItemString (v ,"sts" , PyLong_FromLong ((long )MQSTS_CURRENT_VERSION ));
19161920#endif
19171921#if defined(MQTMC_CURRENT_VERSION )
1918- PyDict_SetItemString (v ,"tmc" , PyLong_FromLong ((long )MQTMC_CURRENT_VERSION ));
1922+ // This constant is defined as a string in the MQI headers. So we hardcode the equivalent int, as it's
1923+ // unlikely to change.
1924+ PyDict_SetItemString (v ,"tmc" , PyLong_FromLong ((long )2 ));
19191925#endif
19201926#if defined(MQTM_CURRENT_VERSION )
19211927 PyDict_SetItemString (v ,"tm" , PyLong_FromLong ((long )MQTM_CURRENT_VERSION ));
0 commit comments