GeezerVison is showing github.com — Updating latest changes from Main. · Bibi31/p4python@5dadfc8
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: MANIFEST.in -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,5 +5,3 @@ include Version | 5 | 5 | include p4test.py | 6 | 6 | include job_trigger.py | 7 | 7 | include tools/*.py | 8 | | - | 9 | | -global-exclude *.pyc |
Collapse file Copy file name to clipboardExpand all lines: P4API.cpp +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 27 | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 28 | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 | 29 | * | 30 | | - * $Id: //depot/main/p4-python/P4API.cpp#62 $ | | 30 | + * $Id: //depot/main/p4-python/P4API.cpp#63 $ | 31 | 31 | * | 32 | 32 | * Build instructions: | 33 | 33 | * Use Distutils - see accompanying setup.py | @@ -237,7 +237,7 @@ static PyObject * P4Adapter_run(P4Adapter * self, PyObject * args) | 237 | 237 | // the other hack is that the API expects (char * const *), but this cannot be stored | 238 | 238 | // a std::vector<>, because it cannot exchange pointers | 239 | 239 |
| 240 | | - return self->clientAPI->Run(GetPythonString(cmd), argv.size(), | | 240 | + return self->clientAPI->Run(GetPythonString(cmd), (int)argv.size(), | 241 | 241 | (argv.size() > 0) ? (char * const *) &argv[0] : NULL ); | 242 | 242 | } | 243 | 243 |
| |
Collapse file Copy file name to clipboardExpand all lines: P4Result.cpp +31-20Lines changed: 31 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 | 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 25 | 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | 26 |
| 27 | | -$Id: //depot/main/p4-python/P4Result.cpp#19 $ | | 27 | +$Id: //depot/main/p4-python/P4Result.cpp#21 $ | 28 | 28 | *******************************************************************************/ | 29 | 29 |
| 30 | 30 | #include <Python.h> | @@ -66,20 +66,25 @@ P4Result::~P4Result() | 66 | 66 | { | 67 | 67 | // reduce references to Python objects to avoid memory leaks | 68 | 68 |
| 69 | | - if (output) | | 69 | + if (output) { | 70 | 70 | Py_DECREF(output); | 71 | | - | 72 | | - if (warnings) | | 71 | + } | | 72 | + | | 73 | + if (warnings) { | 73 | 74 | Py_DECREF(warnings); | 74 | | - | 75 | | - if (errors) | | 75 | + } | | 76 | + | | 77 | + if (errors) { | 76 | 78 | Py_DECREF(errors); | | 79 | + } | 77 | 80 |
| 78 | | - if (messages) | | 81 | + if (messages) { | 79 | 82 | Py_DECREF(messages); | | 83 | + } | 80 | 84 |
| 81 | | - if (track) | 82 | | - Py_DECREF(track); | | 85 | + if (track) { | | 86 | + Py_DECREF(track); | | 87 | + } | 83 | 88 | } | 84 | 89 |
| 85 | 90 | PyObject * P4Result::GetOutput() | @@ -92,24 +97,29 @@ PyObject * P4Result::GetOutput() | 92 | 97 | void | 93 | 98 | P4Result::Reset() | 94 | 99 | { | 95 | | - if (output) | | 100 | + if (output) { | 96 | 101 | Py_DECREF(output); | | 102 | + } | 97 | 103 | output = PyList_New(0); | 98 | 104 |
| 99 | | - if (warnings) | | 105 | + if (warnings) { | 100 | 106 | Py_DECREF(warnings); | | 107 | + } | 101 | 108 | warnings = PyList_New(0); | 102 | 109 |
| 103 | | - if (errors) | | 110 | + if (errors) { | 104 | 111 | Py_DECREF(errors); | | 112 | + } | 105 | 113 | errors = PyList_New(0); | 106 | 114 |
| 107 | | - if (messages) | | 115 | + if (messages) { | 108 | 116 | Py_DECREF(messages); | | 117 | + } | 109 | 118 | messages = PyList_New(0); | 110 | 119 |
| 111 | | - if (track) | 112 | | - Py_DECREF(track); | | 120 | + if (track) { | | 121 | + Py_DECREF(track); | | 122 | + } | 113 | 123 | track = PyList_New(0); | 114 | 124 |
| 115 | 125 | if (output == NULL | @@ -154,8 +164,9 @@ int P4Result::AddTrack( PyObject * t ) | 154 | 164 |
| 155 | 165 | void P4Result::ClearTrack() | 156 | 166 | { | 157 | | - if (track) | 158 | | - Py_DECREF(track); | | 167 | + if (track) { | | 168 | + Py_DECREF(track); | | 169 | + } | 159 | 170 | track = PyList_New(0); | 160 | 171 | } | 161 | 172 |
| @@ -221,13 +232,13 @@ P4Result::AddError( Error *e ) | 221 | 232 | int | 222 | 233 | P4Result::ErrorCount() | 223 | 234 | { | 224 | | - return PyList_Size( errors ); | | 235 | + return (int)PyList_Size( errors ); | 225 | 236 | } | 226 | 237 |
| 227 | 238 | int | 228 | 239 | P4Result::WarningCount() | 229 | 240 | { | 230 | | - return PyList_Size( warnings ); | | 241 | + return (int)PyList_Size( warnings ); | 231 | 242 | } | 232 | 243 |
| 233 | 244 | void | @@ -246,7 +257,7 @@ P4Result::FmtWarnings( StrBuf &buf ) | 246 | 257 | int | 247 | 258 | P4Result::Length( PyObject * list ) | 248 | 259 | { | 249 | | - return PyList_Size( list ); | | 260 | + return (int)PyList_Size( list ); | 250 | 261 | } | 251 | 262 |
| 252 | 263 | void | |
Collapse file Copy file name to clipboardExpand all lines: PythonClientAPI.cpp +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 | 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 26 | 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 | 27 |
| 28 | | -$Id: //depot/main/p4-python/PythonClientAPI.cpp#77 $ | | 28 | +$Id: //depot/main/p4-python/PythonClientAPI.cpp#78 $ | 29 | 29 | *******************************************************************************/ | 30 | 30 |
| 31 | 31 | #include <Python.h> | @@ -619,7 +619,7 @@ PyObject * PythonClientAPI::Convert(const char * charset, PyObject * content) | 619 | 619 | const char * contentAsUTF8 = PyBytes_AS_STRING(bytes); | 620 | 620 |
| 621 | 621 | int retlen = 0; | 622 | | - const char * converted = cvt->FastCvt(contentAsUTF8, strlen(contentAsUTF8), &retlen); | | 622 | + const char * converted = cvt->FastCvt(contentAsUTF8, (int)strlen(contentAsUTF8), &retlen); | 623 | 623 | Py_DECREF( bytes ); // we do not need this object anymore | 624 | 624 |
| 625 | 625 | if (converted == NULL) { | |
Collapse file Copy file name to clipboardExpand all lines: SpecMgr.cpp +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | 25 |
| 26 | | - $Id: //depot/main/p4-python/SpecMgr.cpp#49 $ | | 26 | + $Id: //depot/main/p4-python/SpecMgr.cpp#51 $ | 27 | 27 | *******************************************************************************/ | 28 | 28 |
| 29 | 29 | /******************************************************************************* | @@ -570,10 +570,10 @@ void SpecMgr::SplitKey( const StrPtr *key, StrBuf &base, StrBuf &index ) { | 570 | 570 | base = *key; | 571 | 571 | index = ""; | 572 | 572 | for( size_t i = key->Length(); i; i-- ) { | 573 | | - char prev = (*key)[i - 1]; | | 573 | + char prev = (*key)[(p4size_t)i - 1]; | 574 | 574 | 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); | 577 | 577 | break; | 578 | 578 | } | 579 | 579 | } | @@ -659,7 +659,7 @@ void SpecMgr::InsertItem( PyObject * dict, const StrPtr *var, const StrPtr *val | 659 | 659 |
| 660 | 660 | for( const char *c = 0; (c = index.Contains(comma)); ) { | 661 | 661 | StrBuf level; | 662 | | - level.Set(index.Text(), c - index.Text()); | | 662 | + level.Set(index.Text(), (int)(c - index.Text())); | 663 | 663 | index.Set(c + 1); | 664 | 664 |
| 665 | 665 | // 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 | 703 | 703 | } | 704 | 704 |
| 705 | 705 | buf = "... "; | 706 | | - buf << PyList_Size(list) << "] = " << val->Text(); | | 706 | + buf << (int)PyList_Size(list) << "] = " << val->Text(); | 707 | 707 |
| 708 | 708 | debug->debug ( P4PYDBG_DATA, buf.Text() ); | 709 | 709 |
| |
|