[Kde-bindings] KDE/kdebindings/php/phpqt/src

Thomas Moenicke tm at php-qt.org
Sun Jul 13 23:26:59 UTC 2008


SVN commit 832051 by moenicke:

* removed compiler warnings

CCMAIL: kde-bindings at kde.org



 M  +237 -53   functions.cpp  


--- trunk/KDE/kdebindings/php/phpqt/src/functions.cpp #832050:832051
@@ -48,6 +48,10 @@
    Return a string to confirm that the module is compiled in */
 PHP_FUNCTION(confirm_php_qt_compiled)
 {
+        Q_UNUSED(return_value_ptr);
+        Q_UNUSED(this_ptr);
+        Q_UNUSED(return_value_used);
+
 	char *arg = NULL;
 	int arg_len, len;
 	char string[256];
@@ -56,9 +60,8 @@
 		return;
 	}
 
-  	len = sprintf(string, "Congratulations! Module PHP-Qt is now compiled into PHP.", arg);
+  	len = sprintf(string, "Congratulations! Module PHP-Qt is now compiled into PHP.");
 	RETURN_STRINGL(string, len, 1);
-
 }
 
 /*!
@@ -71,6 +74,10 @@
 
 PHP_FUNCTION(SIGNAL)
 {
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
     const char* string;
     int string_len;
     if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&string,&string_len)) {
@@ -96,6 +103,10 @@
 
 PHP_FUNCTION(SLOT)
 {
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
     const char* string;
     int string_len;
     if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&string,&string_len)) {
@@ -121,6 +132,11 @@
 
 PHP_FUNCTION(emit)
 {
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
     RETURN_NULL();
 }
 
@@ -131,8 +147,13 @@
  *	function defined for compatibility
  */
 
-PHP_FUNCTION(qobject_cast){
-
+PHP_FUNCTION(qobject_cast)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
+    
     zval *obj;
     zval *cast_type;
 
@@ -147,51 +168,66 @@
  	*(return_value_ptr) = obj;
     zval_add_ref(return_value_ptr);
     return;
-
 }
 
 /**
  * qDebug($message) triggers a notice with the given message.
  */
-PHP_FUNCTION(qDebug) {
-	const char* msg;
-	int msglen;
+PHP_FUNCTION(qDebug)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value)
 
-	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&msg,&msglen)==FAILURE) {
-		php_error(E_PARSE,"wrong parameters for qDebug");
-		return;
-	}
-	php_error(E_NOTICE,msg);
-	return;
+    const char* msg;
+    int msglen;
+
+    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&msg,&msglen)==FAILURE) {
+          php_error(E_PARSE,"wrong parameters for qDebug");
+          return;
+    }
+    php_error(E_NOTICE,"%s",msg);
+  return;
 }
 
 /**
  * qWarning($message) triggers a warning with the given message.
  */
 PHP_FUNCTION(qWarning) {
-	const char* msg;
-	int msglen;
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
+    
+    const char* msg;
+    int msglen;
 
-	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&msg,&msglen)==FAILURE) {
-		php_error(E_PARSE,"wrong parameters for qWarning");
-		return;
-	}
-	php_error(E_WARNING,msg);
-	return;
+    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&msg,&msglen)==FAILURE) {
+      php_error(E_PARSE,"wrong parameters for qWarning");
+      return;
+    }
+    php_error(E_WARNING,"%s",msg);
+    return;
 }
 
 /**
  * qCritical($message) triggers a fatal error with the given message.
  */
 PHP_FUNCTION(qCritical) {
-	const char* msg;
-	int msglen;
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
 
+    const char* msg;
+    int msglen;
+
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&msg,&msglen)==FAILURE) {
 		php_error(E_PARSE,"wrong parameters for qCritical");
 		return;
 	}
-	php_error(E_ERROR,msg);
+	php_error(E_ERROR,"%s",msg);
 	return;
 }
 
@@ -199,6 +235,10 @@
  * Returns the absolute value of a number.
  */
 PHP_FUNCTION(qAbs) {
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	double x;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"d",&x)==FAILURE) {
@@ -212,7 +252,13 @@
  * Returns this number rounded to the nearest integer
  * if decimal is greater than .5 it rounds up, otherwise it rounds down
  */
-PHP_FUNCTION(qRound) {
+PHP_FUNCTION(qRound)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
     double x;
     
     if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"d",&x)==FAILURE) {
@@ -226,9 +272,14 @@
  * Returns this number rounded to the nearest integer
  * if decimal is greater than .5 it rounds up, otherwise it rounds down
  */
-PHP_FUNCTION(qRound64) {
-	double x;
+PHP_FUNCTION(qRound64)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
 
+    double x;
+
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"d",&x)==FAILURE) {
 		php_error(E_PARSE,"wrong parameters for qRound");
 		return;
@@ -241,7 +292,11 @@
  * TODO: Make this capable of dealing with objects
  */
 PHP_FUNCTION(qMin) {
-	double x;
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
+        double x;
 	double y;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"dd",&x,&y)==FAILURE) {
@@ -257,7 +312,12 @@
  * Return the larger of two numbers
  * TODO: Make this capable of dealing with objects
  */
-PHP_FUNCTION(qMax) {
+PHP_FUNCTION(qMax)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	double x;
 	double y;
 
@@ -274,7 +334,12 @@
  * Return a value bound by a minimum and maximum value.
  * TODO: Make this capable of dealing with objects
  */
-PHP_FUNCTION(qBound) {
+PHP_FUNCTION(qBound)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	double min;
 	double val;
 	double max;
@@ -297,7 +362,12 @@
 /**
  * Convert a string or character code into a printable character based on local 8 bit character set
  */
-PHP_FUNCTION(qPrintable) {
+PHP_FUNCTION(qPrintable)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	zval* string;
 	QString *ptr;
 	//int string_len;
@@ -343,10 +413,14 @@
 /**
  * Returns true if x-y is between 0.0 and 0.00000000001
  */
-PHP_FUNCTION(qFuzzyCompare) {
+PHP_FUNCTION(qFuzzyCompare)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	double x;
 	double y;
-	double ret;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"dd",&x,&y)==FAILURE) {
 		php_error(E_PARSE,"wrong parameters for qFuzzyCompare");
@@ -361,7 +435,12 @@
  * This varies slightly from the Qt implementation which tests
  * a double or float for a NULL value only.
  */
-PHP_FUNCTION(qIsNull) {
+PHP_FUNCTION(qIsNull)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	zval *var;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"z",&var)==FAILURE) {
@@ -387,7 +466,12 @@
  * This differs from the Qt version which can only convert a float or double to an int
  * TODO: implement __toInt() functionality
  */
-PHP_FUNCTION(qIntCast) {
+PHP_FUNCTION(qIntCast)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
 	zval *var;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"z",&var)==FAILURE)
@@ -417,25 +501,49 @@
 /**
  * Return the version of Qt being used
  */
-PHP_FUNCTION(qVersion) {
+PHP_FUNCTION(qVersion)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	RETURN_STRING(QT_VERSION_STR,1);
 }
 
 /**
  * Return the version of PHP-Qt being used
  */
-PHP_FUNCTION(PHPQtVersion) {
+PHP_FUNCTION(PHPQtVersion)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	RETURN_STRING(PHPQT_VERSION,1);
 }
 
 /**
  * Return the version of QiDi that this release complies with
  */
-PHP_FUNCTION(QiDiVersion) {
+PHP_FUNCTION(QiDiVersion)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	RETURN_STRING(QIDI_VERSION,1);
 }
 
-PHP_FUNCTION(qSharedBuild) {
+PHP_FUNCTION(qSharedBuild)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	RETURN_BOOL(qSharedBuild);
 }
 
@@ -446,7 +554,13 @@
  * it creates a space of allocated memory and assigns to it a null string
  * then returns a pointer to this null string.
  */
-PHP_FUNCTION(qMalloc) {
+PHP_FUNCTION(qMalloc)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	long size;
 	char *tmp;
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"l",&size)==FAILURE)
@@ -459,7 +573,14 @@
 /**
  * Simulate freeing the memory used by a variable by setting it to NULL
  */
-PHP_FUNCTION(qFree) {
+PHP_FUNCTION(qFree)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
+
 	zval* var;
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"z",&var)==FAILURE)
@@ -471,7 +592,13 @@
  * We don't REALLY need to allocate memory in PHP, this is just here for ease of
  * porting code from C++
  */
-PHP_FUNCTION(qRealloc) {
+PHP_FUNCTION(qRealloc)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+
 	zval *val;
 	double size;
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"zd",&val,&size)==FAILURE)
@@ -487,7 +614,14 @@
  * Currently this only supports string, int and float types
  * TODO: add support for array, objects, bool
  */
-PHP_FUNCTION(qMemCopy) {
+PHP_FUNCTION(qMemCopy)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
+
 	zval* dest;
 	zval* src;
 
@@ -527,10 +661,23 @@
 	}
 }
 
-PHP_FUNCTION(qt_noop) {}
+PHP_FUNCTION(qt_noop)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
+}
 
-PHP_FUNCTION(qt_assert) {
 
+PHP_FUNCTION(qt_assert)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
+
 	char* msg;
 	int msglen;
 	char* file;
@@ -539,10 +686,16 @@
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s|sl",&msg,&msglen,&file,&filelen,&line)==FAILURE)
 		return;
-	php_error(E_ERROR,msg);
+	php_error(E_ERROR,"%s",msg);
 }
 
-PHP_FUNCTION(qt_assert_x) {
+PHP_FUNCTION(qt_assert_x)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
 
 	char* msg;
 	int msglen;
@@ -556,11 +709,17 @@
 
 	if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s|sssl",&msg,&msglen,&where,&wherelen,&what,&whatlen,&file,&filelen,&line)==FAILURE)
 		return;
-	php_error(E_ERROR,msg);
+	php_error(E_ERROR,"%s",msg);
 }
 
 
-PHP_FUNCTION(Q_ASSERT) {
+PHP_FUNCTION(Q_ASSERT)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
 
 	bool cond;
 
@@ -570,7 +729,13 @@
 		php_error(E_ERROR,"Assertion failed");
 }
 
-PHP_FUNCTION(Q_ASSERT_X) {
+PHP_FUNCTION(Q_ASSERT_X)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
 
 	bool cond;
 	char* where="";
@@ -586,7 +751,12 @@
 	}
 }
 
-PHP_FUNCTION(qt_check_pointer) {
+PHP_FUNCTION(qt_check_pointer)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
 
 	char* file;
 	int line;
@@ -598,6 +768,10 @@
 
 PHP_FUNCTION(check_qobject)
 {
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(return_value);
 
     zval* zobject;
     if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"z",&zobject)) {
@@ -607,7 +781,13 @@
     PHPQt::check_qobject(zobject);
 }
 
-PHP_FUNCTION(Q_UNUSED) {
+PHP_FUNCTION(Q_UNUSED)
+{
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+    Q_UNUSED(ht);
+    Q_UNUSED(return_value);
 // just nothing
 }
  
@@ -621,6 +801,10 @@
 extern zval* zstringFromQString(QString* s);
 extern "C" PHP_FUNCTION(tr)
 {
+    Q_UNUSED(return_value_ptr);
+    Q_UNUSED(this_ptr);
+    Q_UNUSED(return_value_used);
+
     const char* string;
     int string_len;
     if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"s",&string,&string_len)) {



More information about the Kde-bindings mailing list