From 2fb28b168fac9f3a751d0e36c17f0439173c8430 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Tue, 1 Jul 2014 03:46:25 -0400 Subject: [PATCH] extras; samples: Fixed warnings --- ecere/src/net/NetworkClientFile.ec | 4 +-- extras/audio/dsound.ec | 39 ++++++++++--------------- extras/audio/mixer.ec | 12 ++++---- extras/fliPlay.ec | 8 +++-- extras/gui/LicensesDialog.ec | 2 +- extras/html/HTMLView.ec | 2 +- extras/tiles/astar.ec | 1 - extras/tiles/sequence.ec | 2 +- extras/tiles/sprite.ec | 12 ++++---- extras/tiles/tiles.ec | 1 + samples/3D/HiraganaCube/hiraganaCube.ec | 2 +- samples/3D/ModelViewer/eModel.ec | 6 ++-- samples/3D/ModelViewer/engineSettings.ec | 2 +- samples/3D/hello3D/hello3D.ec | 2 +- samples/3D/orbitWithMouse/orbitWithMouse.ec | 17 +++++------ samples/3D/rayTracedMandelbulb/mandelbulb.ec | 23 +++++++-------- samples/3D/terrainCameraDemo/demo.ec | 2 +- samples/3D/walkAround/walkAround.ec | 5 +--- samples/audio/DirectBufferPlayer/wavPlayer.ec | 4 +-- samples/audio/S3MPlayer/S3MPlayer.ec | 8 ++--- samples/db/MedDB/mainForm.ec | 5 ++-- samples/db/MedDB/med.ec | 2 +- samples/eC/ecas/ecas.ec | 1 + samples/eC/ecas/expression.ec | 16 ++++------ samples/eC/ecas/misc.ec | 16 +++++----- samples/eC/neural/neural.ec | 10 +++---- samples/eC/neural/neurons.ec | 32 +++++++------------- samples/games/bomb/bomb.ec | 4 +-- samples/games/cards/poker/player.ec | 2 +- samples/games/cards/poker/poker.ec | 2 +- samples/games/cards/ruff/src/ai.ec | 2 +- samples/games/cards/ruff/src/ruff.ec | 6 ++-- samples/games/cards/ruff/src/server.ec | 2 +- samples/games/cards/ruff/src/trump.ec | 2 +- samples/games/cards/tongIts/tongits.ec | 8 ++--- samples/games/chess/src/connect.ec | 8 ++--- samples/games/cornerBlocks/cornerBlocks.ec | 20 +++++-------- samples/games/crosswords/CrossWordsServer.ec | 13 ++++----- samples/games/stonePairs/stonePairs.ec | 2 -- samples/guiAndGfx/fractals/GradientDesigner.ec | 18 ++++++------ samples/guiAndGfx/screenShot/shot.ec | 2 +- samples/net/SocketRx/socketRx.ec | 8 ++--- samples/net/SocketSample/socketSample.ec | 4 +-- samples/net/SocketTx/socketTX.ec | 2 +- samples/net/XMLSample/xmlSample.ec | 10 +++---- samples/net/eCom/connection.ec | 10 +++---- samples/net/eCom/mainPanel.ec | 4 +-- samples/net/eirc/console.ec | 14 ++++----- samples/net/eirc/eIRC.ec | 14 ++++----- samples/net/httpserver/http.ec | 10 +++---- samples/net/networkFile/NetworkClient/client.ec | 2 +- samples/net/networkFile/NetworkServer/server.ec | 2 +- samples/net/smtp/smtp.ec | 10 +++---- samples/threads/threadsAndListBoxes/blank.ec | 18 ++++++------ 54 files changed, 199 insertions(+), 236 deletions(-) diff --git a/ecere/src/net/NetworkClientFile.ec b/ecere/src/net/NetworkClientFile.ec index f03ac8d..1b179ce 100644 --- a/ecere/src/net/NetworkClientFile.ec +++ b/ecere/src/net/NetworkClientFile.ec @@ -406,7 +406,7 @@ public class FileServerConnection : Socket { processAlone = true; public: - NetworkClientFile Open(char * fileName, FileOpenMode mode) + NetworkClientFile Open(const char * fileName, FileOpenMode mode) { NetworkClientFile f { }; Request request; @@ -480,7 +480,7 @@ private: } // Packet Sending Functions - void SendOpenPacket(char * fileName) + void SendOpenPacket(const char * fileName) { int len = strlen(fileName); OpenPacket packet = (OpenPacket) new0 byte[sizeof(class OpenPacket) + len]; diff --git a/extras/audio/dsound.ec b/extras/audio/dsound.ec index 3830a51..0fc828b 100644 --- a/extras/audio/dsound.ec +++ b/extras/audio/dsound.ec @@ -34,7 +34,6 @@ static HMIXEROBJ hmx; public void OpenMixer() { - HMIXER mixerHandle; WAVEFORMATEX waveFormat = { 0 }; waveFormat.nSamplesPerSec = 44100; //(cur_stream && cur_stream->audio_st && cur_stream->audio_st->codec) ? cur_stream->audio_st->codec->sample_rate : 44100; waveFormat.wBitsPerSample = 16; @@ -45,7 +44,7 @@ public void OpenMixer() waveFormat.nAvgBytesPerSec = waveFormat.nBlockAlign * waveFormat.nSamplesPerSec; waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); - mixerOpen((HMIXER *)&hmx, (uint)hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT); + mixerOpen((HMIXER *)&hmx, (uint)(uintptr)hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT); } public void CloseMixer() @@ -173,7 +172,7 @@ public int OpenAudio(AudioSpec wanted, AudioSpec result) result.size = dwNotifySize * NUM_PLAY_NOTIFICATIONS; g_pSoundManager.InitStreaming(&streamingSound, NUM_PLAY_NOTIFICATIONS, dwNotifySize, dSoundThread.g_hNotificationEvent, - wanted.callback, wanted.userdata, wanted.channels, wanted.freq, wanted.bits); + (void *)wanted.callback, wanted.userdata, wanted.channels, wanted.freq, wanted.bits); if(streamingSound) { streamingSound.volume = wanted.volume; @@ -207,14 +206,14 @@ public void CloseAudio() static bool PlayBuffer( bool bLooped ) { - void * pDSB; + //void * pDSB; if(!streamingSound) return false; if(streamingSound.Reset()) return false; - pDSB = streamingSound.GetBuffer( 0 ); + //pDSB = streamingSound.GetBuffer( 0 ); SetEvent(dSoundThread.g_hNotificationEvent); return true; @@ -301,7 +300,7 @@ static class StreamingSound int RestoreBuffer( IDirectSoundBuffer * pDSB, bool* pbWasRestored ) { int hr; - uint dwStatus; + DWORD dwStatus; if( pDSB == null ) return CO_E_NOTINITIALIZED; @@ -346,7 +345,7 @@ static class StreamingSound { if( apDSBuffer[i] ) { - uint dwStatus = 0; + DWORD dwStatus = 0; IDirectSoundBuffer_GetStatus(apDSBuffer[i], &dwStatus ); if ( ( dwStatus & DSBSTATUS_PLAYING ) == 0 ) break; @@ -417,6 +416,7 @@ static class StreamingSound return result; } + /* int Stop() { int hr = 0; @@ -429,23 +429,20 @@ static class StreamingSound return hr; } + */ bool HandleWaveStreamNotification( ) { - uint dwCurrentPlayPos; - uint dwPlayDelta; - uint dwBytesWrittenToBuffer; + DWORD dwCurrentPlayPos; void * pDSLockedBuffer = null; void * pDSLockedBuffer2 = null; - uint dwDSLockedBufferSize; - uint dwDSLockedBufferSize2; + DWORD dwDSLockedBufferSize; + DWORD dwDSLockedBufferSize2; uint playCursor, writeCursor; - bool bRestored; uint start, size; - - static uint cursor; bool written = true; int c; + while(written) { written = false; @@ -521,7 +518,6 @@ static class StreamingSound int Reset() { - int hr; bool bRestored; int result; @@ -550,10 +546,8 @@ static class StreamingSound int FillBufferWithSound( IDirectSoundBuffer * pDSB, bool bRepeatWavIfBufferLarger ) { - int hr; - void* pDSLockedBuffer = null; // Pointer to locked buffer memory - uint dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer - uint dwWavDataRead = 0; // Amount of data read from the wav file + void * pDSLockedBuffer = null; // Pointer to locked buffer memory + DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer if( pDSB == null ) return CO_E_NOTINITIALIZED; @@ -569,9 +563,7 @@ static class StreamingSound callback(data, pDSLockedBuffer, dwDSLockedBufferSize); - dwWavDataRead = dwDSLockedBufferSize; - - printf("Filling 16 spots\n"); + // printf("Filling 16 spots\n"); IDirectSoundBuffer_Unlock(pDSB, pDSLockedBuffer, dwDSLockedBufferSize, null, 0 ); //dwNextWriteOffset = dwNotifySize*2; @@ -654,7 +646,6 @@ static class CSoundManager bool InitStreaming(StreamingSound * ppStreamingSound, uint dwNotifyCount, uint dwNotifySize, void * hNotifyEvent, void (*callback)(void * data, void * buffer, int len), void * data, int nChannels, int freq,int bits) { - int hr; IDirectSoundBuffer * pDSBuffer = null; uint dwDSBufferSize = 0; DSBPOSITIONNOTIFY * aPosNotify = null; diff --git a/extras/audio/mixer.ec b/extras/audio/mixer.ec index 8beeddc..cdcb335 100644 --- a/extras/audio/mixer.ec +++ b/extras/audio/mixer.ec @@ -8,9 +8,9 @@ public define AUDIO_BUFFER_SIZE = 48000; struct WAVEHDR { - byte format[4] __attribute__((packed)); + byte format[4]; uint32 f_len __attribute__((packed)); - byte wave_fmt[8] __attribute__((packed)); + byte wave_fmt[8]; uint32 fmt_len __attribute__((packed)); uint16 fmt_tag __attribute__((packed)); uint16 channel __attribute__((packed)); @@ -18,21 +18,21 @@ struct WAVEHDR uint32 avg_bytes_per_sec __attribute__((packed)); uint16 blk_align __attribute__((packed)); uint16 bits_per_sample __attribute__((packed)); - byte data[4] __attribute__((packed)); + byte data[4]; uint32 data_len __attribute__((packed)); }; public class Sound { public: - property String fileName { set { Load(value); } } + property const String fileName { set { Load(value); } } int frequency, bits, channels, length; byte * data; ~Sound() { delete data; } - bool Load(char * fileName) + bool Load(const char * fileName) { bool result = false; WAVEHDR header; @@ -105,7 +105,7 @@ public class Mixer int chn = sound.channels; if(sound.bits == 16) { - short * sBuffer = sound.data; + short * sBuffer = (short *)sound.data; int se = 0; int s = v.pos; short sampleL = sBuffer[s]; diff --git a/extras/fliPlay.ec b/extras/fliPlay.ec index 0ebf97a..83c44da 100644 --- a/extras/fliPlay.ec +++ b/extras/fliPlay.ec @@ -39,7 +39,12 @@ class FliPlay : Window { timer.Stop(); if(!(animation.Load(value))) - Logf("Couldn't load animation %s.\n", value); + { + String s = PrintString("Couldn't load animation ", value, "."); + MessageBox { caption = "Ecere FLC Player", contents = s }.Modal(); + Destroy(0); + delete s; + } else { image.Allocate(null, animation.width, animation.height, 0, pixelFormat8, true); @@ -49,7 +54,6 @@ class FliPlay : Window animation.PlayFrame(image); timer.delay = animation.speed; timer.Start(); - } } diff --git a/extras/gui/LicensesDialog.ec b/extras/gui/LicensesDialog.ec index 838a044..f1ee373 100644 --- a/extras/gui/LicensesDialog.ec +++ b/extras/gui/LicensesDialog.ec @@ -19,7 +19,7 @@ class LicenseTab : Tab readOnly = true; noCaret = true; }; - property char * sourceFile + property const char * sourceFile { set { diff --git a/extras/html/HTMLView.ec b/extras/html/HTMLView.ec index c50114f..6314d7a 100644 --- a/extras/html/HTMLView.ec +++ b/extras/html/HTMLView.ec @@ -1553,7 +1553,7 @@ class HTMLView : Window html.block.ClearEntries(); } - property char * location + property const char * location { set { diff --git a/extras/tiles/astar.ec b/extras/tiles/astar.ec index 9b66d19..8b7eb88 100644 --- a/extras/tiles/astar.ec +++ b/extras/tiles/astar.ec @@ -46,7 +46,6 @@ void AStarTerminate(AStar * aStar) AStar * AStarInitialize(int width, int height, int stackSize) { - AStar * result = null; AStar * aStar = new0 AStar[1]; if(aStar) { diff --git a/extras/tiles/sequence.ec b/extras/tiles/sequence.ec index dab6df2..a230565 100644 --- a/extras/tiles/sequence.ec +++ b/extras/tiles/sequence.ec @@ -61,7 +61,7 @@ Sequence * SequenceInit(uint16 numEvents) return result; } -bool SequenceLoadTable(Sequence **sequences, int count, char *fileName) +bool SequenceLoadTable(Sequence **sequences, int count, const char * fileName) { bool result = false; File f = FileOpen(fileName, read); diff --git a/extras/tiles/sprite.ec b/extras/tiles/sprite.ec index 2842ebb..5835fc9 100644 --- a/extras/tiles/sprite.ec +++ b/extras/tiles/sprite.ec @@ -36,7 +36,7 @@ class Sprite } } - bool Load(char *bmpname, char *sizefile, bool trans, bool usePaletteShades, ColorAlpha * palette, DisplaySystem displaySystem) + bool Load(const char *bmpname, const char *sizefile, bool trans, bool usePaletteShades, ColorAlpha * palette, DisplaySystem displaySystem) { bool result = false; File f = FileOpen(sizefile, read); @@ -45,7 +45,7 @@ class Sprite Bitmap bmpFrames {}; if(bmpFrames.Load(bmpname, null, null)) { - f.Getc(&numFrames); + f.Getc((char *)&numFrames); f.Read(&maxWidth, sizeof(uint16),1); f.Read(&maxHeight, sizeof(uint16),1); frames = new0 SpriteFrame[numFrames]; @@ -57,10 +57,10 @@ class Sprite for(c=0; c 1) { selected = true; - strcpy(fileDialog.filePath, argv[1]); + fileDialog.filePath = argv[1]; } else { - strcpy(fileDialog.filePath, "models/cow/cow.3DS"); + fileDialog.filePath = "models/cow/cow.3DS"; //selected = true; } while(selected || fileDialog.Modal() == ok) @@ -103,7 +103,7 @@ class ModelViewer : Window FillModeValue fillMode; SkyBox sky { size = { 10000, 10000, 10000 }, folder = ":skycube", extension = "jpg" }; - char * modelFile; + const char * modelFile; ModelViewer() { diff --git a/samples/3D/ModelViewer/engineSettings.ec b/samples/3D/ModelViewer/engineSettings.ec index 14aec2f..289c987 100644 --- a/samples/3D/ModelViewer/engineSettings.ec +++ b/samples/3D/ModelViewer/engineSettings.ec @@ -13,7 +13,7 @@ class EngineSettings : Window Resolution resolution; PixelFormat colorDepth; int refreshRate; - char * driver; + const char * driver; driver = "OpenGL"; Picture ecereLogo { this, image = BitmapResource { ":ecere.png", alphaBlend = true }, anchor = { left = 30, top = 10 } }; diff --git a/samples/3D/hello3D/hello3D.ec b/samples/3D/hello3D/hello3D.ec index 241b02d..e50144d 100644 --- a/samples/3D/hello3D/hello3D.ec +++ b/samples/3D/hello3D/hello3D.ec @@ -21,7 +21,7 @@ Light light class Hello3D : Window { - text = "Hello, 3D"; + caption = "Hello, 3D"; background = black; borderStyle = sizable; hasMaximize = true; diff --git a/samples/3D/orbitWithMouse/orbitWithMouse.ec b/samples/3D/orbitWithMouse/orbitWithMouse.ec index 778225f..6ba501a 100644 --- a/samples/3D/orbitWithMouse/orbitWithMouse.ec +++ b/samples/3D/orbitWithMouse/orbitWithMouse.ec @@ -20,7 +20,7 @@ class Window3D : struct Euler offset; }; -static char * iconFiles[] = +static const char * iconFiles[] = { ":icon1.png", ":icon2.png", @@ -992,7 +992,7 @@ class Desktop3D : Window bool OnKeyHit(Key key, unichar character) { static int id = 0; - static char * shotFileNames[] = + static const char * shotFileNames[] = { ":img1.jpg", ":img2.jpg", ":img3.jpg", ":img4.jpg", ":img5.jpg" }; @@ -1082,17 +1082,14 @@ class Desktop3D : Window if(poppingWindow) break; if(sliding == 1.0 && !dockHidden) { - Quaternion fa, ta; - Vector3D fp, tp; - Window window = virtualDesktop.activeChild; if(window) { Window3D window3D = Desktop3DGetWindowHandle(window); camera.Update(); - fa = fromAngle = camera.cOrientation; - fp = fromPosition = camera.cPosition; + fromAngle = camera.cOrientation; + fromPosition = camera.cPosition; camera.type = lookAt; camera.position = { 0,0,0 }; @@ -1105,8 +1102,8 @@ class Desktop3D : Window dockHidden = true; camera.Update(); - tp = toPosition = camera.cPosition; - ta = toAngle = camera.cOrientation; + toPosition = camera.cPosition; + toAngle = camera.cOrientation; camera.AdjustAngle(fromAngle); camera.AdjustPosition(fromPosition); @@ -1299,7 +1296,7 @@ static void Update3DWindow(Window window, Box box) int w = box.right - box.left + 1; int h = box.bottom - box.top + 1; - glBindTexture(GL_TEXTURE_2D, (int)window3D.bitmap.driverData); + glBindTexture(GL_TEXTURE_2D, (int)(intptr)window3D.bitmap.driverData); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); diff --git a/samples/3D/rayTracedMandelbulb/mandelbulb.ec b/samples/3D/rayTracedMandelbulb/mandelbulb.ec index cfc7d21..d6b30dd 100644 --- a/samples/3D/rayTracedMandelbulb/mandelbulb.ec +++ b/samples/3D/rayTracedMandelbulb/mandelbulb.ec @@ -200,8 +200,6 @@ class RenderThread : Thread for(y = start; y <= end && !view3D.abort; y++) { - Box box { 0, y, bitmap.width, y }; - for(x = 0; x < bitmap.width && !view3D.abort; x++) { Vector3D v, end; @@ -489,7 +487,6 @@ class RTCube : RTObject { int c; bool visible = true; - int sign = 0; planes[plane].IntersectLine(ray, intersect); for(c = 0; c < 6; c++) { @@ -622,7 +619,6 @@ class RTMandelbulb : RTCube void Compute() { - Quaternion q; bulb.size = size; bulb.power = power; RTCube::Compute(); @@ -633,8 +629,10 @@ class RTMandelbulb : RTCube double t = 0; int refine = 0; double refineDT = dt; + double refineDT10 = refineDT * 10; double stopT = MAXDOUBLE; bool firstPointInside = false; + Vector3D halfSize = { size.x / 2, size.y / 2, size.z / 2 }; if(backwards && bulb.IsPointInside(l.p0, iters)) { firstPointInside = true; @@ -649,11 +647,11 @@ class RTMandelbulb : RTCube l.p0.y - l.delta.y * t, l.p0.z - l.delta.z * t }; - if(p.x + refineDT*10 < -size.x / 2 || p.x - refineDT*10 > size.x / 2 || - p.y + refineDT*10 < -size.y / 2 || p.y - refineDT*10 > size.y / 2 || - p.z + refineDT*10 < -size.z / 2 || p.z - refineDT*10 > size.z / 2) + if(p.x + refineDT10 < -halfSize.x || p.x - refineDT10 > halfSize.x || + p.y + refineDT10 < -halfSize.y || p.y - refineDT10 > halfSize.y || + p.z + refineDT10 < -halfSize.z || p.z - refineDT10 > halfSize.z) { - Print(""); + // Print(""); break; } @@ -663,6 +661,7 @@ class RTMandelbulb : RTCube stopT = t; t -= refineDT; refineDT /= 2; + refineDT10 = refineDT * 10; } if(t > stopT) { @@ -786,25 +785,25 @@ class RTMandelbulb : RTCube double d2 = (found[1] && found[2]) ? (distances[1] * distances[2]) : MAXDOUBLE; double d3 = (found[2] && found[3]) ? (distances[2] * distances[3]) : MAXDOUBLE; double d4 = (found[3] && found[0]) ? (distances[3] * distances[0]) : MAXDOUBLE; - if(d1 < minDistance || d1 < d2 && d1 < d3 && d1 < d4) + if(d1 < minDistance || (d1 < d2 && d1 < d3 && d1 < d4)) { normalPlane.FromPoints(points[1], p, points[0]); normal.Add(normal, normalPlane.normal); count++; } - if(d2 < minDistance || d2 < d1 && d2 < d3 && d2 < d4) + if(d2 < minDistance || (d2 < d1 && d2 < d3 && d2 < d4)) { normalPlane.FromPoints(points[2], p, points[1]); normal.Add(normal, normalPlane.normal); count++; } - if(d1 < minDistance || d3 < d1 && d3 < d2 && d3 < d4) + if(d1 < minDistance || (d3 < d1 && d3 < d2 && d3 < d4)) { normalPlane.FromPoints(points[3], p, points[2]); normal.Add(normal, normalPlane.normal); count++; } - if(d4 < minDistance || d4 < d1 && d4 < d2 && d4 < d2) + if(d4 < minDistance || (d4 < d1 && d4 < d2 && d4 < d2)) { normalPlane.FromPoints(points[0], p, points[3]); normal.Add(normal, normalPlane.normal); diff --git a/samples/3D/terrainCameraDemo/demo.ec b/samples/3D/terrainCameraDemo/demo.ec index 138d484..7df9449 100644 --- a/samples/3D/terrainCameraDemo/demo.ec +++ b/samples/3D/terrainCameraDemo/demo.ec @@ -131,7 +131,7 @@ static bool LoadTerrain(Terrain terrain, const char * fileName, Angle lat) // OutputTexture("res/texture.png"); - if(terrain.Create(heightMap, 16, 1025, 2, resLon, RESOLUTION_LAT, 512,512)) + if(terrain.Create(heightMap, 16, 1025, 2, resLon, (float)RESOLUTION_LAT, 512,512)) result = true; delete f; } diff --git a/samples/3D/walkAround/walkAround.ec b/samples/3D/walkAround/walkAround.ec index 128b955..0006983 100644 --- a/samples/3D/walkAround/walkAround.ec +++ b/samples/3D/walkAround/walkAround.ec @@ -135,7 +135,7 @@ class WalkAroundForm : Window int i; for(i = 0; i < map.count; i++) { - int num = map[i] = GetRandom(0, 7); + map[i] = GetRandom(0, 7); elv[i] = GetRandom(1, 100); } } @@ -144,7 +144,6 @@ class WalkAroundForm : Window { Bitmap textureFile { }; int i, x, y; - PrimitiveGroup group; cowModel.Load(":cow.3DS", null, displaySystem); cowModel.Merge(displaySystem); @@ -203,8 +202,6 @@ class WalkAroundForm : Window { int ix = y * width + x; int num = map[ix]; - int xs = -((tileSize+gap) * width) / 2; - int ys = -((tileSize+gap) * height) / 2; float h = elv[ix]; Cube cube { }; diff --git a/samples/audio/DirectBufferPlayer/wavPlayer.ec b/samples/audio/DirectBufferPlayer/wavPlayer.ec index 1d5bebb..b9c87db 100644 --- a/samples/audio/DirectBufferPlayer/wavPlayer.ec +++ b/samples/audio/DirectBufferPlayer/wavPlayer.ec @@ -2,7 +2,7 @@ import "EcereAudio" class Form1 : Window { - text = "Form1"; + caption = "Form1"; background = activeBorder; borderStyle = sizable; hasMaximize = true; @@ -15,7 +15,7 @@ class Form1 : Window Button button1 { - this, text = "Play", position = { 200, 168 }; + this, caption = "Play", position = { 200, 168 }; bool NotifyClicked(Button button, int x, int y, Modifiers mods) { diff --git a/samples/audio/S3MPlayer/S3MPlayer.ec b/samples/audio/S3MPlayer/S3MPlayer.ec index bcfa070..55280f7 100644 --- a/samples/audio/S3MPlayer/S3MPlayer.ec +++ b/samples/audio/S3MPlayer/S3MPlayer.ec @@ -1,7 +1,7 @@ import "EcereAudio" static uint16 periods[] = { 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 907}; -static String notes[12] = { "C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"}; +static const String notes[12] = { "C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"}; struct S3MHeader { @@ -79,7 +79,7 @@ class S3M Array patterns { }; Voice voices[32]; - bool Load(char *fileName) + bool Load(const char *fileName) { int i,p,c; byte what, row, channel; @@ -245,7 +245,7 @@ class S3M SND_SetVolume(volume, channel); SND_Play(ins.sound, channel); */ - int c2spd = ins.header.c2spd; + //int c2spd = ins.header.c2spd; //double freq = pow(Do_, note) * pow(2, octave-4) / (c2spd/8363.0); double freq = 14317456.0 / note_st3period / 22150/2; //double freq = 500.0/note_st3period; @@ -290,7 +290,7 @@ class S3M bool Play(Mixer mixer) { bool result = false; - int initSpeed = header.initSpeed; + // int initSpeed = header.initSpeed; Time time = /*pattern == 10*/ 1? speed/(1.1*45.5) : 0; Time current = GetTime(); diff --git a/samples/db/MedDB/mainForm.ec b/samples/db/MedDB/mainForm.ec index 3fcb2c3..782c4ce 100644 --- a/samples/db/MedDB/mainForm.ec +++ b/samples/db/MedDB/mainForm.ec @@ -228,11 +228,12 @@ class MedTesting : Window FormConcentrations formConcentrations = row.formConcentrations; // if(commercialNames.OnCompare(*(void **)boxCommercialNames.data)) - if(class(StringList)._vTbl[__ecereVMethodID_class_OnCompare](class(StringList), commercialNames, *(void **)boxCommercialNames.data)) + + if(((int (*)(Class, StringList, StringList))class(StringList)._vTbl[__ecereVMethodID_class_OnCompare])(class(StringList), commercialNames, *(void **)boxCommercialNames.data)) boxCommercialNames.foreground = red; // if(genericName.OnCompare(*(void **)boxGenericName.data)) - if(class(String)._vTbl[__ecereVMethodID_class_OnCompare](class(String), genericName, *(void **)boxGenericName.data)) + if(((int (*)(Class, const String, const String))class(String)._vTbl[__ecereVMethodID_class_OnCompare])(class(String), genericName, *(void **)boxGenericName.data)) boxGenericName.foreground = red; if(drugClass.OnCompare(boxClass.data)) diff --git a/samples/db/MedDB/med.ec b/samples/db/MedDB/med.ec index ba6e275..ca9741a 100644 --- a/samples/db/MedDB/med.ec +++ b/samples/db/MedDB/med.ec @@ -49,7 +49,7 @@ public: } else { - class(double)._vTbl[__ecereVMethodID_class_OnGetString](class(double), &amount, amountString, null, null); + ((const char * (*)(Class, double *, char *, void *, bool *)) class(double)._vTbl[__ecereVMethodID_class_OnGetString])(class(double), &amount, amountString, null, null); if(form) { String formName = form.name; diff --git a/samples/eC/ecas/ecas.ec b/samples/eC/ecas/ecas.ec index 60f9605..ae9cdee 100644 --- a/samples/eC/ecas/ecas.ec +++ b/samples/eC/ecas/ecas.ec @@ -77,6 +77,7 @@ class Form1 : Window inputString.Deselect(); inputString.AddS(button.text); inputString.Update(null); + return true; } Label statusLabel { this, size = { 274, 21 }, position = { 250, 45 } }; Button ebutton { this, text = constant_string[e], NotifyClicked = TypeButton, size = { 20, 20 }, position = { 170, 45 } }; diff --git a/samples/eC/ecas/expression.ec b/samples/eC/ecas/expression.ec index 2e851d1..323d99c 100644 --- a/samples/eC/ecas/expression.ec +++ b/samples/eC/ecas/expression.ec @@ -446,13 +446,10 @@ public: } //Note that FromString likes to toy with the string, but anything done to the string will be undone. - bool FromString(char *str, CASDictionary dictionary) { + bool FromString(const char *str, CASDictionary dictionary) { ExpressionFromString(this, str, dictionary); return Sanitize(this, dictionary); } - char *ToString(void) { - - } const char *OpString(void) { if (type==prefix && prefix.op