Skip to content

Commit

Permalink
Use %F (ignores locale) for internal representation of floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Dec 25, 2006
1 parent ff0a238 commit 0776e56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ext/exif/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,7 @@ PHP_FUNCTION(exif_read_data)
exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
}
if (ImageInfo.FocalLength) {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1fmm", ImageInfo.FocalLength);
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
if(ImageInfo.CCDWidth) {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
}
Expand All @@ -3924,19 +3924,19 @@ PHP_FUNCTION(exif_read_data)
}
if(ImageInfo.ExposureTime>0) {
if(ImageInfo.ExposureTime <= 0.5) {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
} else {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s", ImageInfo.ExposureTime);
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
}
}
if(ImageInfo.ApertureFNumber) {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1f", ImageInfo.ApertureFNumber);
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
}
if(ImageInfo.Distance) {
if(ImageInfo.Distance<0) {
exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
} else {
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2fm", ImageInfo.Distance);
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
}
}
if (ImageInfo.UserComment) {
Expand Down
2 changes: 1 addition & 1 deletion ext/informix/ifx.ec
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ PHP_MINFO_FUNCTION(ifx)
php_info_print_table_row(2, "Active Persistent links", buf);
sprintf(buf, "%ld", IFXG(num_links));
php_info_print_table_row(2, "Active links", buf);
sprintf(buf, "%02.2f", (double)(IFX_VERSION/100.0));
sprintf(buf, "%02.2F", (double)(IFX_VERSION/100.0));
php_info_print_table_row(2, "ESQL/C Version", buf);
php_info_print_table_end();

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/http_fopen_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_stream_context_get_option(context, "http", "protocol_version", &tmpzval) == SUCCESS) {
SEPARATE_ZVAL(tmpzval);
convert_to_double_ex(tmpzval);
protocol_version_len = spprintf(&protocol_version, 0, "%.1f", Z_DVAL_PP(tmpzval));
protocol_version_len = spprintf(&protocol_version, 0, "%.1F", Z_DVAL_PP(tmpzval));
}

if (!scratch) {
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/microtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
} else {
char ret[100];

snprintf(ret, 100, "%.8f %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec);
snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec);
RETURN_STRING(ret, 1);
}
}
Expand Down

0 comments on commit 0776e56

Please sign in to comment.