Skip to content

Commit 5dadfc8

Browse files
committed
Updating latest changes from Main.
1 parent 3a24392 commit 5dadfc8

5 files changed

Lines changed: 41 additions & 32 deletions

File tree

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ include Version
55
include p4test.py
66
include job_trigger.py
77
include tools/*.py
8-
9-
global-exclude *.pyc

P4API.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*
30-
* $Id: //depot/main/p4-python/P4API.cpp#62 $
30+
* $Id: //depot/main/p4-python/P4API.cpp#63 $
3131
*
3232
* Build instructions:
3333
* Use Distutils - see accompanying setup.py
@@ -237,7 +237,7 @@ static PyObject * P4Adapter_run(P4Adapter * self, PyObject * args)
237237
// the other hack is that the API expects (char * const *), but this cannot be stored
238238
// a std::vector<>, because it cannot exchange pointers
239239

240-
return self->clientAPI->Run(GetPythonString(cmd), argv.size(),
240+
return self->clientAPI->Run(GetPythonString(cmd), (int)argv.size(),
241241
(argv.size() > 0) ? (char * const *) &argv[0] : NULL );
242242
}
243243

P4Result.cpp

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2424
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2525
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
27-
$Id: //depot/main/p4-python/P4Result.cpp#19 $
27+
$Id: //depot/main/p4-python/P4Result.cpp#21 $
2828
*******************************************************************************/
2929

3030
#include <Python.h>
@@ -66,20 +66,25 @@ P4Result::~P4Result()
6666
{
6767
// reduce references to Python objects to avoid memory leaks
6868

69-
if (output)
69+
if (output) {
7070
Py_DECREF(output);
71-
72-
if (warnings)
71+
}
72+
73+
if (warnings) {
7374
Py_DECREF(warnings);
74-
75-
if (errors)
75+
}
76+
77+
if (errors) {
7678
Py_DECREF(errors);
79+
}
7780

78-
if (messages)
81+
if (messages) {
7982
Py_DECREF(messages);
83+
}
8084

81-
if (track)
82-
Py_DECREF(track);
85+
if (track) {
86+
Py_DECREF(track);
87+
}
8388
}
8489

8590
PyObject * P4Result::GetOutput()
@@ -92,24 +97,29 @@ PyObject * P4Result::GetOutput()
9297
void
9398
P4Result::Reset()
9499
{
95-
if (output)
100+
if (output) {
96101
Py_DECREF(output);
102+
}
97103
output = PyList_New(0);
98104

99-
if (warnings)
105+
if (warnings) {
100106
Py_DECREF(warnings);
107+
}
101108
warnings = PyList_New(0);
102109

103-
if (errors)
110+
if (errors) {
104111
Py_DECREF(errors);
112+
}
105113
errors = PyList_New(0);
106114

107-
if (messages)
115+
if (messages) {
108116
Py_DECREF(messages);
117+
}
109118
messages = PyList_New(0);
110119

111-
if (track)
112-
Py_DECREF(track);
120+
if (track) {
121+
Py_DECREF(track);
122+
}
113123
track = PyList_New(0);
114124

115125
if (output == NULL
@@ -154,8 +164,9 @@ int P4Result::AddTrack( PyObject * t )
154164

155165
void P4Result::ClearTrack()
156166
{
157-
if (track)
158-
Py_DECREF(track);
167+
if (track) {
168+
Py_DECREF(track);
169+
}
159170
track = PyList_New(0);
160171
}
161172

@@ -221,13 +232,13 @@ P4Result::AddError( Error *e )
221232
int
222233
P4Result::ErrorCount()
223234
{
224-
return PyList_Size( errors );
235+
return (int)PyList_Size( errors );
225236
}
226237

227238
int
228239
P4Result::WarningCount()
229240
{
230-
return PyList_Size( warnings );
241+
return (int)PyList_Size( warnings );
231242
}
232243

233244
void
@@ -246,7 +257,7 @@ P4Result::FmtWarnings( StrBuf &buf )
246257
int
247258
P4Result::Length( PyObject * list )
248259
{
249-
return PyList_Size( list );
260+
return (int)PyList_Size( list );
250261
}
251262

252263
void

PythonClientAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2626
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28-
$Id: //depot/main/p4-python/PythonClientAPI.cpp#77 $
28+
$Id: //depot/main/p4-python/PythonClientAPI.cpp#78 $
2929
*******************************************************************************/
3030

3131
#include <Python.h>
@@ -619,7 +619,7 @@ PyObject * PythonClientAPI::Convert(const char * charset, PyObject * content)
619619
const char * contentAsUTF8 = PyBytes_AS_STRING(bytes);
620620

621621
int retlen = 0;
622-
const char * converted = cvt->FastCvt(contentAsUTF8, strlen(contentAsUTF8), &retlen);
622+
const char * converted = cvt->FastCvt(contentAsUTF8, (int)strlen(contentAsUTF8), &retlen);
623623
Py_DECREF( bytes ); // we do not need this object anymore
624624

625625
if (converted == NULL) {

SpecMgr.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2424
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
26-
$Id: //depot/main/p4-python/SpecMgr.cpp#49 $
26+
$Id: //depot/main/p4-python/SpecMgr.cpp#51 $
2727
*******************************************************************************/
2828

2929
/*******************************************************************************
@@ -570,10 +570,10 @@ void SpecMgr::SplitKey( const StrPtr *key, StrBuf &base, StrBuf &index ) {
570570
base = *key;
571571
index = "";
572572
for( size_t i = key->Length(); i; i-- ) {
573-
char prev = (*key)[i - 1];
573+
char prev = (*key)[(p4size_t)i - 1];
574574
if( !isdigit(prev) && prev != ',' ) {
575-
base.Set(key->Text(), i);
576-
index.Set(key->Text() + i);
575+
base.Set(key->Text(), (p4size_t)i);
576+
index.Set(key->Text() + (p4size_t)i);
577577
break;
578578
}
579579
}
@@ -659,7 +659,7 @@ void SpecMgr::InsertItem( PyObject * dict, const StrPtr *var, const StrPtr *val
659659

660660
for( const char *c = 0; (c = index.Contains(comma)); ) {
661661
StrBuf level;
662-
level.Set(index.Text(), c - index.Text());
662+
level.Set(index.Text(), (int)(c - index.Text()));
663663
index.Set(c + 1);
664664

665665
// Found another level so we need to get/create a nested array
@@ -703,7 +703,7 @@ void SpecMgr::InsertItem( PyObject * dict, const StrPtr *var, const StrPtr *val
703703
}
704704

705705
buf = "... ";
706-
buf << PyList_Size(list) << "] = " << val->Text();
706+
buf << (int)PyList_Size(list) << "] = " << val->Text();
707707

708708
debug->debug ( P4PYDBG_DATA, buf.Text() );
709709

0 commit comments

Comments
 (0)