Skip to content

Instantly share code, notes, and snippets.

@DopefishJustin
Created April 9, 2012 18:56
Show Gist options
  • Save DopefishJustin/2345504 to your computer and use it in GitHub Desktop.
Save DopefishJustin/2345504 to your computer and use it in GitHub Desktop.
Clang fixes for MAME
diff --git a/src/emu/device.h b/src/emu/device.h
index df101d9..a20d341 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -377,9 +377,10 @@ protected:
virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); }
// operators to make use transparent
- operator _PointerType *() { return m_target; }
operator _PointerType *() const { return m_target; }
_PointerType *operator->() { return m_target; }
+ _PointerType &operator[](int index) { return m_target[index]; }
+ _PointerType operator[](int index) const { return m_target[index]; }
// getter for explicit fetching
_PointerType *target() const { return m_target; }
diff --git a/src/emu/video/polynew.h b/src/emu/video/polynew.h
index 296d214..4b5fd55 100644
--- a/src/emu/video/polynew.h
+++ b/src/emu/video/polynew.h
@@ -1112,10 +1112,10 @@ int poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::zclip_if_less(i
const vertex_t &v1 = v[(vertnum == 0) ? (numverts - 1) : (vertnum - 1)];
const vertex_t &v2 = v[vertnum];
_BaseType frac = (clipval - v1.p[0]) / (v2.p[0] - v1.p[0]);
- nextout.x = v1.x + frac * (v2.x - v1.x);
- nextout.y = v1.y + frac * (v2.y - v1.y);
+ nextout->x = v1.x + frac * (v2.x - v1.x);
+ nextout->y = v1.y + frac * (v2.y - v1.y);
for (int paramnum = 0; paramnum < paramcount; paramnum++)
- nextout.p[paramnum] = v1.p[paramnum] + frac * (v2.p[paramnum] - v1.p[paramnum]);
+ nextout->p[paramnum] = v1.p[paramnum] + frac * (v2.p[paramnum] - v1.p[paramnum]);
nextout++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment