euphoria

changeset 5366:8ea7ee43ea6a 4.0

* merge
author Shawn Pringle <shawn.pringle@gmail.com>
date Fri Dec 16 21:29:02 2011 -0300 (17 months ago)
parents f9521141db89 800c7b360edf
children 33cc69578863
files
line diff
     1.1 --- a/source/be_machine.c	Fri Dec 16 08:03:50 2011 -0300
     1.2 +++ b/source/be_machine.c	Fri Dec 16 21:29:02 2011 -0300
     1.3 @@ -484,23 +484,25 @@
     1.4  static object Cursor(object x)
     1.5  /* set style of cursor */
     1.6  {
     1.7 +	
     1.8 +#ifdef EWINDOWS
     1.9  	short style;
    1.10 -#ifdef EWINDOWS
    1.11  	CONSOLE_CURSOR_INFO c;
    1.12 -#endif
    1.13  	style = get_int(x);
    1.14 -#ifdef EWINDOWS
    1.15  	c.dwSize = (style == 0x0607) ? 12 :
    1.16  			   (style == 0x0507) ? 25 :
    1.17  			   (style == 0x0407) ? 50 :
    1.18  								  100;
    1.19  	c.bVisible = (style != 0x02000);
    1.20  	SetConsoleCursorInfo(console_output, &c);
    1.21 +	return ATOM_1;
    1.22  #endif
    1.23  #ifdef EUNIX
    1.24  	// leaveok(stdscr, style != 0x02000); doesn't work very well
    1.25 +	x = 1;
    1.26 +	return x;
    1.27  #endif
    1.28 -	return ATOM_1;
    1.29 +	
    1.30  }
    1.31  
    1.32  static object TextRows(object x)
    1.33 @@ -2229,7 +2231,7 @@
    1.34     */
    1.35  {
    1.36  	static unsigned char *page_addr = NULL;
    1.37 -	static unsigned int page_offset = 0;
    1.38 +	static long page_offset = 0;
    1.39  	static long call_increment = 0;
    1.40  	static long last_block_offset = 0;
    1.41  	unsigned addr;
    1.42 @@ -2499,9 +2501,9 @@
    1.43  	is_batch = console_application();
    1.44  #endif
    1.45  #ifdef ERUNTIME
    1.46 -	RTFatal("A machine-level exception occurred during execution of your program");
    1.47 +	RTFatal("A machine-level exception occurred during execution of your program (signal %d)", sig_no);
    1.48  #else
    1.49 -	RTFatal("A machine-level exception occurred during execution of this statement");
    1.50 +	RTFatal("A machine-level exception occurred during execution of this statement (signal %d)", sig_no);
    1.51  #endif
    1.52  }
    1.53  
     2.1 --- a/source/be_runtime.c	Fri Dec 16 08:03:50 2011 -0300
     2.2 +++ b/source/be_runtime.c	Fri Dec 16 21:29:02 2011 -0300
     2.3 @@ -2442,6 +2442,8 @@
     2.4  
     2.5  object calc_MD5(object a)
     2.6  {
     2.7 +#if 0
     2.8 +// TODO: MD5 Unimplemented!
     2.9  	object lTempResult;
    2.10  	long lSLen;
    2.11  	int tfi;
    2.12 @@ -2487,12 +2489,14 @@
    2.13  			lSLen--;
    2.14  		}
    2.15  	}
    2.16 -
    2.17 -	return 0;
    2.18 +#endif
    2.19 +	return a ^ a;
    2.20  }
    2.21  
    2.22  object calc_SHA256(object a)
    2.23  {
    2.24 +#if 0
    2.25 +// TODO: SHA256 Unimplemented!
    2.26  	object lTempResult;
    2.27  	long lSLen;
    2.28  	int tfi;
    2.29 @@ -2539,8 +2543,8 @@
    2.30  			lSLen--;
    2.31  		}
    2.32  	}
    2.33 -
    2.34 -	return 0;
    2.35 +#endif
    2.36 +	return a ^ a;
    2.37  }
    2.38  
    2.39  
    2.40 @@ -3171,7 +3175,6 @@
    2.41  long find(object a, s1_ptr b)
    2.42  /* find object a as an element of sequence b */
    2.43  {
    2.44 -	long length;
    2.45  	object_ptr bp;
    2.46  	object bv;
    2.47  
    2.48 @@ -3232,7 +3235,6 @@
    2.49  
    2.50  		long a_len;
    2.51  
    2.52 -		length = b->length;
    2.53  		a_len = SEQ_PTR(a)->length;
    2.54  		while (TRUE) {
    2.55  			bv = *(++bp);
    2.56 @@ -3649,7 +3651,7 @@
    2.57  	IFILE fp;
    2.58  	long length;
    2.59  	int i;
    2.60 -	long mode, text_mode;
    2.61 +	long mode;
    2.62  	cleanup_ptr cup;
    2.63  
    2.64  	if (IS_ATOM(mode_obj))
    2.65 @@ -3668,14 +3670,12 @@
    2.66  	MakeCString(cmode, mode_obj, EOpen_cmode_len );
    2.67  
    2.68  	length = strlen(cmode);
    2.69 -	text_mode = 1;  /* assume text file */
    2.70  	if (strcmp(cmode, "r") == 0) {
    2.71  		mode = EF_READ;
    2.72  	}
    2.73  
    2.74  	else if (strcmp(cmode, "rb") == 0) {
    2.75  		mode = EF_READ;
    2.76 -		text_mode = 0;
    2.77  	}
    2.78  
    2.79  	else if (strcmp(cmode, "w") == 0) {
    2.80 @@ -3684,7 +3684,6 @@
    2.81  
    2.82  	else if (strcmp(cmode, "wb") == 0) {
    2.83  		mode = EF_WRITE;
    2.84 -		text_mode = 0;
    2.85  	}
    2.86  
    2.87  	else if (strcmp(cmode, "a") == 0) {
    2.88 @@ -3693,12 +3692,10 @@
    2.89  
    2.90  	else if (strcmp(cmode, "ab") == 0) {
    2.91  		mode = EF_WRITE | EF_APPEND;
    2.92 -		text_mode = 0;
    2.93  	}
    2.94  
    2.95  	else if (strcmp(cmode, "ub") == 0) {
    2.96  		mode = EF_READ | EF_WRITE;
    2.97 -		text_mode = 0;
    2.98  		copy_string(cmode, "r+b", EOpen_cmode_len);
    2.99  	}
   2.100  
     3.1 --- a/source/be_socket.c	Fri Dec 16 08:03:50 2011 -0300
     3.2 +++ b/source/be_socket.c	Fri Dec 16 21:29:02 2011 -0300
     3.3 @@ -2066,9 +2066,7 @@
     3.4  	object level, optname;
     3.5  	int optval;
     3.6  	size_t optlen;
     3.7 -	object_ptr base;
     3.8  	
     3.9 -	base = SEQ_PTR(x)->base;
    3.10  	if (!IS_SOCKET(SEQ_PTR(x)->base[1]))
    3.11  		RTFatal("first argument to get_option must be a socket");
    3.12  	if (!IS_ATOM_INT(level = ATOM_TO_ATOM_INT(SEQ_PTR(x)->base[2])))
     4.1 --- a/source/be_task.c	Fri Dec 16 08:03:50 2011 -0300
     4.2 +++ b/source/be_task.c	Fri Dec 16 21:29:02 2011 -0300
     4.3 @@ -1040,8 +1040,7 @@
     4.4   */
     4.5  
     4.6  static void init_task( int tx ){
     4.7 -	int ret;
     4.8 -	ret = pthread_create( &tcb[tx].impl.translated.task, NULL, &start_task, (void*)tx );
     4.9 +	pthread_create( &tcb[tx].impl.translated.task, NULL, &start_task, (void*)tx );
    4.10  	// TODO error handling
    4.11  }
    4.12  
    4.13 @@ -1061,15 +1060,11 @@
    4.14  void scheduler(double now)
    4.15  // pick the next task to run
    4.16  {
    4.17 -	volatile int stack_top;  // magic variable set/read via ASM code
    4.18 -							 // force it to not be kept in a register
    4.19  	double earliest_time, start_time;
    4.20  	int ts_found;
    4.21  	struct tcb *tp;
    4.22  	int p;
    4.23  
    4.24 -	// first check the real-time tasks
    4.25 -	stack_top = 0; // so the compiler thinks it's used.
    4.26  	
    4.27  	// find the task with the earliest MAX_TIME
    4.28  	earliest_task = rt_first;
     5.1 --- a/source/execute.h	Fri Dec 16 08:03:50 2011 -0300
     5.2 +++ b/source/execute.h	Fri Dec 16 21:29:02 2011 -0300
     5.3 @@ -40,9 +40,9 @@
     5.4  #define IS_ATOM_INT(ob)       (((long)(ob)) > NOVALUE)
     5.5  #define IS_ATOM_INT_NV(ob)    ((long)(ob) >= NOVALUE)
     5.6  
     5.7 -#define MAKE_UINT(x) ((object)((unsigned long)x <= (unsigned long)0x3FFFFFFFL \
     5.8 +#define MAKE_UINT(x) ((object)(( ((unsigned long)x) <= ((unsigned long)0x3FFFFFFFL)) \
     5.9                            ? (unsigned long)x : \
    5.10 -                            NewDouble((double)(unsigned long)x)))
    5.11 +                            (unsigned long)NewDouble((double)(unsigned long)x)))
    5.12  
    5.13  /* these are obsolete */
    5.14  #define INT_VAL(x)        ((int)(x))

SCM Home | OpenEuphoria.org Home