Skip to content

Commit

Permalink
Fix win and mac compiler warnings
Browse files Browse the repository at this point in the history
Verified with latest build of libsvm (3.14). Tweaked some types to avoid a bunch of smallish compiler warnings.
  • Loading branch information
ianbarber authored and Ian Barber committed Nov 23, 2012
1 parent 421a1c7 commit 4466aee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
11 changes: 6 additions & 5 deletions package.xml
Expand Up @@ -14,10 +14,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
<email>ian.barber@gmail.co.uk</email>
<active>yes</active>
</lead>
<date>2012-09-16</date>
<time>15:00:00</time>
<date>2012-11-23</date>
<time>20:00:00</time>
<version>
<release>0.1.8</release>
<release>0.1.9</release>
<api>0.1.5</api>
</version>
<stability>
Expand All @@ -26,8 +26,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- Fixed GH#2 issue when loading data from a resource
- Modify include search path to start more generic
- Verified works with 3.14
- Fixed option return format
- Removed unused variable
</notes>
<contents>
<dir name="/">
Expand Down
20 changes: 10 additions & 10 deletions svm.c
Expand Up @@ -290,7 +290,7 @@ static struct svm_problem* php_svm_read_array(php_svm_object *intern, php_svm_mo
char *endptr;
int i, num_labels, elements;
int j = 0, max_index = 0, inst_max_index = 0;
long index;
unsigned long index;
struct svm_problem *problem;

/* If reading multiple times make sure that we don't leak */
Expand Down Expand Up @@ -439,7 +439,7 @@ Take an incoming parameter and convert it into a PHP array of svmlight style dat
*/
static zval* php_svm_get_data_from_param(php_svm_object *intern, zval *zparam TSRMLS_DC)
{
zval *data, *return_value;
zval *data;
zend_bool our_stream = 0;
zend_bool need_read = 1;
php_stream *stream = NULL;
Expand Down Expand Up @@ -597,13 +597,13 @@ PHP_METHOD(svm, getOptions)
add_index_long(return_value, phpsvm_probability, intern->param.probability == 1 ? TRUE : FALSE);
add_index_long(return_value, phpsvm_shrinking, intern->param.shrinking == 1 ? TRUE : FALSE);

add_index_long(return_value, phpsvm_gamma, intern->param.gamma);
add_index_long(return_value, phpsvm_coef0, intern->param.coef0);
add_index_long(return_value, phpsvm_nu, intern->param.nu);
add_index_long(return_value, phpsvm_cache_size, intern->param.cache_size);
add_index_long(return_value, phpsvm_C, intern->param.C);
add_index_long(return_value, phpsvm_eps, intern->param.eps);
add_index_long(return_value, phpsvm_p, intern->param.p);
add_index_double(return_value, phpsvm_gamma, intern->param.gamma);
add_index_double(return_value, phpsvm_coef0, intern->param.coef0);
add_index_double(return_value, phpsvm_nu, intern->param.nu);
add_index_double(return_value, phpsvm_cache_size, intern->param.cache_size);
add_index_double(return_value, phpsvm_C, intern->param.C);
add_index_double(return_value, phpsvm_eps, intern->param.eps);
add_index_double(return_value, phpsvm_p, intern->param.p);
}
/* }}} */

Expand Down Expand Up @@ -779,7 +779,7 @@ PHP_METHOD(svm, train)
HashTable *weights_ht;
int i;
char *key;
long index;
unsigned long index;

zend_bool status = 0;
weights = 0;
Expand Down

0 comments on commit 4466aee

Please sign in to comment.