Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /LIME-examples/simple-test/source.c [r23] .. [r24] Maximize Restore

  Switch to side-by-side view

--- a/LIME-examples/simple-test/source.c
+++ b/LIME-examples/simple-test/source.c
@@ -1,4 +1,9 @@
 /****************************************************************
+Simple source to demonstrate LIME
+Uses state defined statically.
+
+Copyright 2008 Pjotr Kourzanov
+
 This file is part of LIME.
 
 LIME is free software: you can redistribute it and/or modify
@@ -13,37 +18,22 @@
 You should have received a copy of the GNU General Public License
 along with LIME.  If not, see <http://www.gnu.org/licenses/>.
 ****************************************************************/
-/****************************************************************
-This file is part of LIME.
+#include LIME
 
-LIME is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 2
-as published by the Free Software Foundation.
+/* This struct is defined externally */
+struct state;
 
-LIME is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with LIME.  If not, see <http://www.gnu.org/licenses/>.
-****************************************************************/
-#include DOMAIN
-
-/* Both of these structs are defined externally */
-struct source_state;
-
-static struct source_state state;
-void process(unsigned int buf[restrict BUF_SIZE])
+static struct state _state;
+actor process(unsigned int buf[restrict BUF_SIZE])
 {
 	unsigned int i;
 
 	for(i=0; i< BUF_SIZE; i++)
 	{
-		buf[i] = state.count;
-		state.count++;
+		buf[i] = _state.count;
+		_state.count++;
 		/* Wrap on signed 24 bits value */
-		state.count &= 0x7fffff;
+		_state.count &= 0x7fffff;
 	}
 }