Skip to content

Instantly share code, notes, and snippets.

View jerstlouis's full-sized avatar

Jerome St-Louis jerstlouis

View GitHub Profile
eC Coding Style Conventions
February 13, 2017 -- Draft version 0.3
=========================================
Identifiers Naming
------------------
- camelCase is used throughout for types and identifiers
- Types (classes/structs, enums...) start with an UpperCase
- Identifiers (global, local, member variables; functions, methods, enumeration values) start with a lowerCase
- Exception: Previously, Functions/Methods used to start with an UpperCase.
This was inconsistent and caused various issues, so new convention is lowerCase.
package com.ecere.hello;
public class hello extends android.app.NativeActivity
{
static
{
System.loadLibrary("ecere");
System.loadLibrary("hello");
}
}
struct MyStruct { int x, y; };
class OtherClass { };
class MyClass
{
MyStruct myStructMember { };
OtherClass myClassMember { };
int a, b;
};
bool figurePosition(int x, int y, Point pos)
{
OldList list {};
display.StartSelection(x,y, 0,0);
display.SetCamera(null, camera);
display.CollectHits();
display.IntersectPolygons();
pos = { -1, -1 };
import "ecere"
class Form1 : Window
{
caption = $"Form1", background = formColor;
borderStyle = sizable, hasMaximize = true, hasMinimize = true, hasClose = true;
clientSize = { 632, 438 };
Button button1
{
public define Phi = 1.6180339887;
bool IsPerfectSquare(uint64 number)
{
double root = sqrt(number);
uint64 square = (uint64)root * (uint64)root;
return square == number;
}
struct Matrix2x2
import "ecere"
class Form : Window
{
Form()
{
printf("Form()\n");
}
caption = $"Form1";
background = formColor;
#define MODULE_NAME "HelloForm"
// #define __CONSOLE_APP__
#include "ecere.hpp"
class HelloForm : public Window
{
public:
Label label;
diff --git a/ecere/src/sys/JSON.ec b/ecere/src/sys/JSON.ec
index cc793b7..9d63b68 100644
--- a/ecere/src/sys/JSON.ec
+++ b/ecere/src/sys/JSON.ec
@@ -702,24 +702,13 @@ private:
bool isKey = false;
bool isTemplateArg = false;
uint offset = 0;
- if(eCON)
+
Program received signal SIGSEGV, Segmentation fault.
0x000000006bdc79ea in __ecereMethod___ecereNameSpace__ecere__com__Array_Free (this=0x0) at src/com/containers/Array.ec:375
375 for(c = 0; c<count; c++)
(gdb) list
370 }
371
372 void Free()
373 {
374 int c;
375 for(c = 0; c<count; c++)