cvs: ZendEngine2 / zend_operators.c

[email protected] ("Jani Taskinen") Mon, 11 May 2009 00:40:10 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvsjani1242002410@cvsserver>
jani		Mon May 11 00:40:10 2009 UTC

  Modified files:              
    /ZendEngine2	zend_operators.c 
  Log:
  - Nuked more whitespace
jani-20090511004010.txt (text/plain, 9.8 KB)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.304&r2=1.305&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.304 ZendEngine2/zend_operators.c:1.305
--- ZendEngine2/zend_operators.c:1.304	Thu Mar 26 22:16:47 2009
+++ ZendEngine2/zend_operators.c	Mon May 11 00:40:10 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_operators.c,v 1.304 2009/03/26 22:16:47 felipe Exp $ */
+/* $Id: zend_operators.c,v 1.305 2009/05/11 00:40:10 jani Exp $ */
 
 #include <ctype.h>
 
@@ -282,9 +282,9 @@
 			case IS_STRING:											\
 				Z_LVAL(holder) = strtol(Z_STRVAL_P(op), NULL, 10);	\
 				break;												\
-			case IS_UNICODE:                                        \
+			case IS_UNICODE:										\
 				Z_LVAL(holder) = zend_u_strtol(Z_USTRVAL_P(op), NULL, 10);	\
-				break;                                              \
+				break;											  \
 			case IS_ARRAY:											\
 				Z_LVAL(holder) = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);	\
 				break;												\
@@ -332,15 +332,15 @@
 					Z_LVAL(holder) = 1;								\
 				}													\
 				break;												\
-			case IS_UNICODE:                                        \
+			case IS_UNICODE:										\
 				if (Z_USTRLEN_P(op) == 0	 						\
 					|| (Z_USTRLEN_P(op)==1 &&	 					\
 						(Z_USTRVAL_P(op)[0]=='0'))) {				\
-					Z_LVAL(holder) = 0;		                        \
-				} else {                                            \
-					Z_LVAL(holder) = 1;		                        \
-				}                                                   \
-				break;                                              \
+					Z_LVAL(holder) = 0;								\
+				} else {											\
+					Z_LVAL(holder) = 1;								\
+				}												   \
+				break;											  \
 			case IS_ARRAY:											\
 				Z_LVAL(holder) = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);	\
 				break;												\
@@ -873,7 +873,7 @@
 
 ZEND_API int _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC) /* {{{ */
 {
-    return _convert_to_unicode_with_converter(op, ZEND_U_CONVERTER(UG(runtime_encoding_conv)) TSRMLS_CC ZEND_FILE_LINE_CC);
+	return _convert_to_unicode_with_converter(op, ZEND_U_CONVERTER(UG(runtime_encoding_conv)) TSRMLS_CC ZEND_FILE_LINE_CC);
 }
 /* }}} */
 
@@ -923,7 +923,7 @@
 			Z_USTRVAL_P(op) = eustrndup(result, result_len);
 			Z_USTRLEN_P(op) = result_len;
 			break;
-	    }
+		}
 		case IS_DOUBLE: {
 			UChar num_buf[NUM_BUF_SIZE], *result;
 			double dval = Z_DVAL_P(op);
@@ -995,8 +995,8 @@
 
 ZEND_API int _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
 {
-    TSRMLS_FETCH();
-    return _convert_to_string_with_converter(op, ZEND_U_CONVERTER(UG(runtime_encoding_conv)) TSRMLS_CC ZEND_FILE_LINE_CC);
+	TSRMLS_FETCH();
+	return _convert_to_string_with_converter(op, ZEND_U_CONVERTER(UG(runtime_encoding_conv)) TSRMLS_CC ZEND_FILE_LINE_CC);
 }
 /* }}} */
 
@@ -1906,7 +1906,7 @@
 
 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
 {
-    int ret;
+	int ret;
 	int converted = 0;
 	zval op1_copy, op2_copy;
 	zval *op_free;
@@ -2013,7 +2013,7 @@
 						zend_free_obj_get_result(op_free TSRMLS_CC);
 						return ret;
 					} else if (Z_TYPE_P(op2) != IS_OBJECT &&
-					           Z_OBJ_HT_P(op1)->cast_object) {
+							   Z_OBJ_HT_P(op1)->cast_object) {
 						ALLOC_INIT_ZVAL(op_free);
 						if (Z_OBJ_HT_P(op1)->cast_object(op1, op_free, Z_TYPE_P(op2), NULL TSRMLS_CC) == FAILURE) {
 							ZVAL_LONG(result, 1);
@@ -2032,7 +2032,7 @@
 						zend_free_obj_get_result(op_free TSRMLS_CC);
 						return ret;
 					} else if (Z_TYPE_P(op1) != IS_OBJECT &&
-					           Z_OBJ_HT_P(op2)->cast_object) {
+							   Z_OBJ_HT_P(op2)->cast_object) {
 						ALLOC_INIT_ZVAL(op_free);
 						if (Z_OBJ_HT_P(op2)->cast_object(op2, op_free, Z_TYPE_P(op1), NULL TSRMLS_CC) == FAILURE) {
 							ZVAL_LONG(result, -1);
@@ -2245,12 +2245,12 @@
 
 static void increment_string(zval *str) /* {{{ */
 {
-    int carry=0;
-    int pos=Z_STRLEN_P(str)-1;
-    char *s=Z_STRVAL_P(str);
-    char *t;
-    int last=0; /* Shut up the compiler warning */
-    int ch;
+	int carry=0;
+	int pos=Z_STRLEN_P(str)-1;
+	char *s=Z_STRVAL_P(str);
+	char *t;
+	int last=0; /* Shut up the compiler warning */
+	int ch;
 
 	if (Z_STRLEN_P(str) == 0) {
 		STR_FREE(Z_STRVAL_P(str));
@@ -2260,74 +2260,74 @@
 	}
 
 	while (pos >= 0) {
-        ch = s[pos];
-        if (ch >= 'a' && ch <= 'z') {
-            if (ch == 'z') {
-                s[pos] = 'a';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last=LOWER_CASE;
-        } else if (ch >= 'A' && ch <= 'Z') {
-            if (ch == 'Z') {
-                s[pos] = 'A';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last=UPPER_CASE;
-        } else if (ch >= '0' && ch <= '9') {
-            if (ch == '9') {
-                s[pos] = '0';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last = NUMERIC;
-        } else {
-            carry=0;
-            break;
-        }
-        if (carry == 0) {
-            break;
-        }
-        pos--;
-    }
-
-    if (carry) {
-        t = (char *) emalloc(Z_STRLEN_P(str)+1+1);
-        memcpy(t+1, Z_STRVAL_P(str), Z_STRLEN_P(str));
-        Z_STRLEN_P(str)++;
-        t[Z_STRLEN_P(str)] = '\0';
-        switch (last) {
-            case NUMERIC:
-            	t[0] = '1';
-            	break;
-            case UPPER_CASE:
-            	t[0] = 'A';
-            	break;
-            case LOWER_CASE:
-            	t[0] = 'a';
-            	break;
-        }
-        STR_FREE(Z_STRVAL_P(str));
-        Z_STRVAL_P(str) = t;
-    }
+		ch = s[pos];
+		if (ch >= 'a' && ch <= 'z') {
+			if (ch == 'z') {
+				s[pos] = 'a';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last=LOWER_CASE;
+		} else if (ch >= 'A' && ch <= 'Z') {
+			if (ch == 'Z') {
+				s[pos] = 'A';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last=UPPER_CASE;
+		} else if (ch >= '0' && ch <= '9') {
+			if (ch == '9') {
+				s[pos] = '0';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last = NUMERIC;
+		} else {
+			carry=0;
+			break;
+		}
+		if (carry == 0) {
+			break;
+		}
+		pos--;
+	}
+
+	if (carry) {
+		t = (char *) emalloc(Z_STRLEN_P(str)+1+1);
+		memcpy(t+1, Z_STRVAL_P(str), Z_STRLEN_P(str));
+		Z_STRLEN_P(str)++;
+		t[Z_STRLEN_P(str)] = '\0';
+		switch (last) {
+			case NUMERIC:
+				t[0] = '1';
+				break;
+			case UPPER_CASE:
+				t[0] = 'A';
+				break;
+			case LOWER_CASE:
+				t[0] = 'a';
+				break;
+		}
+		STR_FREE(Z_STRVAL_P(str));
+		Z_STRVAL_P(str) = t;
+	}
 }
 /* }}} */
 
 static void increment_unicode(zval *str) /* {{{ */
 {
-    int carry=0;
-    int pos=Z_USTRLEN_P(str)-1;
-    UChar *s=Z_USTRVAL_P(str);
-    UChar *t;
-    int last=0; /* Shut up the compiler warning */
-    int ch;
+	int carry=0;
+	int pos=Z_USTRLEN_P(str)-1;
+	UChar *s=Z_USTRVAL_P(str);
+	UChar *t;
+	int last=0; /* Shut up the compiler warning */
+	int ch;
 
 	if (Z_USTRLEN_P(str) == 0) {
 		USTR_FREE(Z_USTRVAL_P(str));
@@ -2336,63 +2336,63 @@
 	}
 
 	while (pos >= 0) {
-        ch = s[pos];
-        if (ch >= 'a' && ch <= 'z') {
-            if (ch == 'z') {
-                s[pos] = 'a';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last=LOWER_CASE;
-        } else if (ch >= 'A' && ch <= 'Z') {
-            if (ch == 'Z') {
-                s[pos] = 'A';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last=UPPER_CASE;
-        } else if (ch >= '0' && ch <= '9') {
-            if (ch == '9') {
-                s[pos] = '0';
-                carry=1;
-            } else {
-                s[pos]++;
-                carry=0;
-            }
-            last = NUMERIC;
-        } else {
-            carry=0;
-            break;
-        }
-        if (carry == 0) {
-            break;
-        }
-        pos--;
-    }
-
-    if (carry) {
-        t = (UChar *) eumalloc(Z_USTRLEN_P(str)+1+1);
-        memcpy(t+1, Z_USTRVAL_P(str), UBYTES(Z_USTRLEN_P(str)));
-        Z_USTRLEN_P(str)++;
-        t[Z_USTRLEN_P(str)] = 0;
-        switch (last) {
-            case NUMERIC:
-            	t[0] = '1';
-            	break;
-            case UPPER_CASE:
-            	t[0] = 'A';
-            	break;
-            case LOWER_CASE:
-            	t[0] = 'a';
-            	break;
-        }
-        USTR_FREE(Z_USTRVAL_P(str));
-        Z_USTRVAL_P(str) = t;
-    }
+		ch = s[pos];
+		if (ch >= 'a' && ch <= 'z') {
+			if (ch == 'z') {
+				s[pos] = 'a';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last=LOWER_CASE;
+		} else if (ch >= 'A' && ch <= 'Z') {
+			if (ch == 'Z') {
+				s[pos] = 'A';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last=UPPER_CASE;
+		} else if (ch >= '0' && ch <= '9') {
+			if (ch == '9') {
+				s[pos] = '0';
+				carry=1;
+			} else {
+				s[pos]++;
+				carry=0;
+			}
+			last = NUMERIC;
+		} else {
+			carry=0;
+			break;
+		}
+		if (carry == 0) {
+			break;
+		}
+		pos--;
+	}
+
+	if (carry) {
+		t = (UChar *) eumalloc(Z_USTRLEN_P(str)+1+1);
+		memcpy(t+1, Z_USTRVAL_P(str), UBYTES(Z_USTRLEN_P(str)));
+		Z_USTRLEN_P(str)++;
+		t[Z_USTRLEN_P(str)] = 0;
+		switch (last) {
+			case NUMERIC:
+				t[0] = '1';
+				break;
+			case UPPER_CASE:
+				t[0] = 'A';
+				break;
+			case LOWER_CASE:
+				t[0] = 'a';
+				break;
+		}
+		USTR_FREE(Z_USTRVAL_P(str));
+		Z_USTRVAL_P(str) = t;
+	}
 }
 /* }}} */
 
@@ -2563,7 +2563,7 @@
 #ifdef ZEND_USE_TOLOWER_L
 ZEND_API void zend_update_current_locale(void) /* {{{ */
 {
-        current_locale = _get_current_locale();
+	current_locale = _get_current_locale();
 }
 /* }}} */
 #endif