diff options
Diffstat (limited to 'src/emu/netlist/plib/plists.h')
-rw-r--r-- | src/emu/netlist/plib/plists.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index bbb553eb12a..af3521bd7db 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -499,8 +499,7 @@ public: } p = p->m_next; } - //FXIME: throw a standard exception - //nl_assert_always(false, "element not found"); + throw pexception("element not found"); } } @@ -581,12 +580,12 @@ public: pstring col = ""; int i = 0; - while (i<str.len()) + while (i<str.blen()) { int p = -1; for (std::size_t j=0; j < onstrl.size(); j++) { - if (std::strncmp(onstrl[j].cstr(), &(str.cstr()[i]), onstrl[j].len())==0) + if (std::memcmp(onstrl[j].cstr(), &(str.cstr()[i]), onstrl[j].blen())==0) { p = j; break; @@ -596,14 +595,16 @@ public: { if (col != "") temp.add(col); + col = ""; temp.add(onstrl[p]); - i += onstrl[p].len(); + i += onstrl[p].blen(); } else { - col += str.cstr()[i]; - i++; + pstring::traits::code_t c = pstring::traits::code(str.cstr() + i); + col += c; + i+=pstring::traits::codelen(c); } } if (col != "") @@ -640,9 +641,9 @@ struct phash_functor<pstring> phash_functor(const pstring &v) { /* modified djb2 */ - const char *string = v.cstr(); + const pstring::mem_t *string = v.cstr(); unsigned result = 5381; - for (UINT8 c = *string; c != 0; c = *string++) + for (pstring::mem_t c = *string; c != 0; c = *string++) result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ c; //result = (result*33) ^ c; m_hash = result; |