Skip to content

Commit

Permalink
Small tweaks:
Browse files Browse the repository at this point in the history
- change <ptr>.ToInt32() to <ptr>.ToInt64() for 64 bit compatibility
- remove a few warnings
  • Loading branch information
mm1352000 committed Oct 8, 2012
1 parent 7e0fc46 commit 5def630
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
Expand Up @@ -412,7 +412,7 @@ private bool ReadMmi(int slot, out MenuData menu)
int offset = 16;
for (int i = 0; i < menu.EntryCount + 3; i++)
{
IntPtr stringPtr = new IntPtr(_mmiBuffer.ToInt32() + offset);
IntPtr stringPtr = new IntPtr(_mmiBuffer.ToInt64() + offset);
String entry = Marshal.PtrToStringAnsi(stringPtr);
switch (i)
{
Expand Down
Expand Up @@ -1130,7 +1130,7 @@ private int GetDeviceId(IBaseFilter tunerFilter)
}

// Calculate the address of the first medium.
IntPtr addr = new IntPtr(raw.ToInt32() + 8);
IntPtr addr = new IntPtr(raw.ToInt64() + 8);
// Marshal the data into an RPM structure.
RegPinMedium rpm = (RegPinMedium)Marshal.PtrToStructure(addr, typeof(RegPinMedium));
return rpm.dw1;
Expand Down Expand Up @@ -1396,7 +1396,7 @@ private void OnDisplayMenuOrList(IntPtr context, byte slotIndex, Int16 numEntrie
byte charChode;
for (int i = 0; i < totalMenuLength - 1; i++) // There is an extra NULL character to indicate the end of the menu.
{
charChode = Marshal.ReadByte((IntPtr)(entries.ToInt32() + i));
charChode = Marshal.ReadByte((IntPtr)(entries.ToInt64() + i));
// Start of a new entry?
if (strings[idx] == null)
{
Expand Down Expand Up @@ -1632,7 +1632,7 @@ public override bool Initialise(IBaseFilter tunerFilter, CardType tunerType, Str
}

_deviceHandle = bdaapiOpenHWIdx(_deviceCategory, (uint)deviceId);
if (_deviceHandle == IntPtr.Zero || _deviceHandle.ToInt32() == -1)
if (_deviceHandle == IntPtr.Zero || _deviceHandle.ToInt64() == -1)
{
Log.Debug("TechnoTrend: hardware interface could not be opened");
return false;
Expand Down
Expand Up @@ -400,7 +400,7 @@ public int OnTeletextReceived(IntPtr data, short packetCount)
{
for (int i = 0; i < packetCount; ++i)
{
IntPtr packetPtr = new IntPtr(data.ToInt32() + i * 188);
IntPtr packetPtr = new IntPtr(data.ToInt64() + i * 188);
ProcessPacket(packetPtr);
}
}
Expand Down
Expand Up @@ -136,8 +136,6 @@ private class MpTsAnalyzer {}

private readonly TimeShiftingEPGGrabber _timeshiftingEPGGrabber;

protected bool _cancelTune;

#endregion

#region ctor
Expand Down
Expand Up @@ -487,7 +487,6 @@ public override void CancelTune()
{
Log.Log.Debug("TvDvbChannel: subchannel {0} cancel tune", _subChannelId);
_cancelTune = true;
_cancelTune = true;
if (_eventCa != null)
{
_eventCa.Set();
Expand Down

0 comments on commit 5def630

Please sign in to comment.