ben 97/07/05 14:30:25
Modified: src mod_dir.c mod_negotiation.c
Log:
Fix more VC++ warnings.
Revision Changes Path
1.31 +2 -2 apache/src/mod_dir.c
Index: mod_dir.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_dir.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C3 -r1.30 -r1.31
*** mod_dir.c 1997/06/24 03:03:48 1.30
--- mod_dir.c 1997/07/05 21:30:22 1.31
***************
*** 561,567 ****
p=(struct ent *)pcalloc(r->pool, sizeof(struct ent));
p->name = pstrdup (r->pool, name);
! p->size = -1;
p->icon = NULL;
p->alt = NULL;
p->desc = NULL;
--- 561,567 ----
p=(struct ent *)pcalloc(r->pool, sizeof(struct ent));
p->name = pstrdup (r->pool, name);
! p->size = 0;
p->icon = NULL;
p->alt = NULL;
p->desc = NULL;
***************
*** 577,583 ****
p->icon = find_default_icon(d,"^^DIRECTORY^^");
if(!(p->alt = find_alt(d,rr,1)))
p->alt = "DIR";
! p->size = -1;
p->name = pstrcat (r->pool, name, "/", NULL);
}
else {
--- 577,583 ----
p->icon = find_default_icon(d,"^^DIRECTORY^^");
if(!(p->alt = find_alt(d,rr,1)))
p->alt = "DIR";
! p->size = 0;
p->name = pstrcat (r->pool, name, "/", NULL);
}
else {
1.45 +34 -33 apache/src/mod_negotiation.c
Index: mod_negotiation.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -C3 -r1.44 -r1.45
*** mod_negotiation.c 1997/06/30 22:50:40 1.44
--- mod_negotiation.c 1997/07/05 21:30:23 1.45
***************
*** 250,267 ****
mime_info->description = "";
mime_info->is_pseudo_html = 0;
! mime_info->level = 0.0;
! mime_info->level_matched = 0.0;
! mime_info->bytes = 0;
mime_info->lang_index = -1;
mime_info->mime_stars = 0;
mime_info->definite = 1;
! mime_info->charset_quality = 1.0;
! mime_info->type_quality = 0.0;
mime_info->encoding_quality = 1;
! mime_info->lang_quality = 1.0;
! mime_info->accept_type_quality = 1.0;
}
/* Initializing the relevant fields of a variant record from the
--- 250,267 ----
mime_info->description = "";
mime_info->is_pseudo_html = 0;
! mime_info->level = 0.0f;
! mime_info->level_matched = 0.0f;
! mime_info->bytes = 0.0f;
mime_info->lang_index = -1;
mime_info->mime_stars = 0;
mime_info->definite = 1;
! mime_info->charset_quality = 1.0f;
! mime_info->type_quality = 0.0f;
mime_info->encoding_quality = 1;
! mime_info->lang_quality = 1.0f;
! mime_info->accept_type_quality = 1.0f;
}
/* Initializing the relevant fields of a variant record from the
***************
*** 294,302 ****
char *get_entry (pool *p, accept_rec *result, char *accept_line)
{
! result->quality = 1.0;
! result->max_bytes = 0.0;
! result->level = 0.0;
result->charset = "";
/* Note that this handles what I gather is the "old format",
--- 294,302 ----
char *get_entry (pool *p, accept_rec *result, char *accept_line)
{
! result->quality = 1.0f;
! result->max_bytes = 0.0f;
! result->level = 0.0f;
result->charset = "";
/* Note that this handles what I gather is the "old format",
***************
*** 321,331 ****
if (!strcmp (result->type_name, "text/html")
&& result->level == 0.0)
! result->level = 2.0;
else if (!strcmp (result->type_name, INCLUDES_MAGIC_TYPE))
! result->level = 2.0;
else if (!strcmp (result->type_name, INCLUDES_MAGIC_TYPE3))
! result->level = 3.0;
while (*accept_line == ';') {
/* Parameters ... */
--- 321,331 ----
if (!strcmp (result->type_name, "text/html")
&& result->level == 0.0)
! result->level = 2.0f;
else if (!strcmp (result->type_name, INCLUDES_MAGIC_TYPE))
! result->level = 2.0f;
else if (!strcmp (result->type_name, INCLUDES_MAGIC_TYPE3))
! result->level = 3.0f;
while (*accept_line == ';') {
/* Parameters ... */
***************
*** 509,526 ****
accept_rec *new_accept = (accept_rec *)push_array (neg->accepts);
new_accept->type_name = CGI_MAGIC_TYPE;
! new_accept->quality = prefer_scripts ? 1e-20 : 1e20;
! new_accept->level = 0.0;
! new_accept->max_bytes = 0.0;
if (neg->accepts->nelts > 1) return;
new_accept = (accept_rec *)push_array (neg->accepts);
new_accept->type_name = "*/*";
! new_accept->quality = 1.0;
! new_accept->level = 0.0;
! new_accept->max_bytes = 0.0;
}
/*****************************************************************
--- 509,526 ----
accept_rec *new_accept = (accept_rec *)push_array (neg->accepts);
new_accept->type_name = CGI_MAGIC_TYPE;
! new_accept->quality = prefer_scripts ? 1e-20f : 1e20f;
! new_accept->level = 0.0f;
! new_accept->max_bytes = 0.0f;
if (neg->accepts->nelts > 1) return;
new_accept = (accept_rec *)push_array (neg->accepts);
new_accept->type_name = "*/*";
! new_accept->quality = 1.0f;
! new_accept->level = 0.0f;
! new_accept->max_bytes = 0.0f;
}
/*****************************************************************
***************
*** 1006,1017 ****
var_rec *variant = &avail_recs[j];
if (variant->content_languages &&
variant->content_languages->nelts) {
! neg->default_lang_quality = 0.001;
return;
}
}
! neg->default_lang_quality = 1.0;
}
/* Set the language_quality value in the variant record. Also
--- 1006,1017 ----
var_rec *variant = &avail_recs[j];
if (variant->content_languages &&
variant->content_languages->nelts) {
! neg->default_lang_quality = 0.001f;
return;
}
}
! neg->default_lang_quality = 1.0f;
}
/* Set the language_quality value in the variant record. Also
***************
*** 1081,1087 ****
* from all the languages on the variant description.
*/
int j;
! float fiddle_q = 0.0;
accept_rec *accs = (accept_rec *)neg->accept_langs->elts;
accept_rec *best = NULL, *star = NULL;
char *p;
--- 1081,1087 ----
* from all the languages on the variant description.
*/
int j;
! float fiddle_q = 0.0f;
accept_rec *accs = (accept_rec *)neg->accept_langs->elts;
accept_rec *best = NULL, *star = NULL;
char *p;
***************
*** 1148,1154 ****
if ((p = strchr(accs[i].type_name, '-'))) {
int plen = p - accs[i].type_name;
if (!strncmp(lang, accs[i].type_name, plen))
! fiddle_q = 0.001;
}
}
}
--- 1148,1154 ----
if ((p = strchr(accs[i].type_name, '-'))) {
int plen = p - accs[i].type_name;
if (!strncmp(lang, accs[i].type_name, plen))
! fiddle_q = 0.001f;
}
}
}
***************
*** 1190,1196 ****
* machinery. At some point, that ought to be fixed.
*/
! int find_content_length(negotiation_state *neg, var_rec *variant)
{
struct stat statb;
--- 1190,1196 ----
* machinery. At some point, that ought to be fixed.
*/
! float find_content_length(negotiation_state *neg, var_rec *variant)
{
struct stat statb;
***************
*** 1198,1204 ****
char *fullname = make_full_path (neg->pool, neg->dir_name,
variant->file_name);
! if (stat (fullname, &statb) >= 0) variant->bytes = statb.st_size;
}
return variant->bytes;
--- 1198,1205 ----
char *fullname = make_full_path (neg->pool, neg->dir_name,
variant->file_name);
! if (stat (fullname, &statb) >= 0)
! variant->bytes = (float)statb.st_size; /* Note, precision may be
lost */
}
return variant->bytes;
***************
*** 1214,1220 ****
{
int i;
accept_rec *accept_recs = (accept_rec *)neg->accepts->elts;
! float q = 0.0;
int q_definite = 1;
/* if no Accept: header, leave quality alone (will
--- 1215,1221 ----
{
int i;
accept_rec *accept_recs = (accept_rec *)neg->accepts->elts;
! float q = 0.0f;
int q_definite = 1;
/* if no Accept: header, leave quality alone (will
***************
*** 1261,1268 ****
* of ending up with them if there's something better.
*/
! if (!neg->accept_q && variant->mime_stars == 1) q = 0.01;
! else if (!neg->accept_q && variant->mime_stars == 2) q = 0.02;
else q = type->quality;
q_definite = (variant->mime_stars == 3);
--- 1262,1269 ----
* of ending up with them if there's something better.
*/
! if (!neg->accept_q && variant->mime_stars == 1) q = 0.01f;
! else if (!neg->accept_q && variant->mime_stars == 2) q = 0.02f;
else q = type->quality;
q_definite = (variant->mime_stars == 3);
***************
*** 1317,1325 ****
}
/* If this variant is in charset iso-8859-1, the default is 1.0 */
if (strcmp(charset, "iso-8859-1") == 0) {
! variant->charset_quality = 1.0;
} else {
! variant->charset_quality = 0.0;
}
}
--- 1318,1326 ----
}
/* If this variant is in charset iso-8859-1, the default is 1.0 */
if (strcmp(charset, "iso-8859-1") == 0) {
! variant->charset_quality = 1.0f;
} else {
! variant->charset_quality = 0.0f;
}
}
***************
*** 1458,1464 ****
* (just about).
*/
! float is_variant_better(negotiation_state *neg, var_rec *variant, var_rec
*best, float *p_bestq)
{
float bestq = *p_bestq, q;
int levcmp;
--- 1459,1465 ----
* (just about).
*/
! int is_variant_better(negotiation_state *neg, var_rec *variant, var_rec
*best, float *p_bestq)
{
float bestq = *p_bestq, q;
int levcmp;
***************
*** 1568,1574 ****
{
int j;
var_rec *best = NULL;
! float bestq = 0.0;
enum algorithm_results algorithm_result = na_not_applied;
var_rec *avail_recs = (var_rec *)neg->avail_vars->elts;
--- 1569,1575 ----
{
int j;
var_rec *best = NULL;
! float bestq = 0.0f;
enum algorithm_results algorithm_result = na_not_applied;
var_rec *avail_recs = (var_rec *)neg->avail_vars->elts;
***************
*** 1724,1730 ****
else if (strcmp(sample_charset, variant->content_charset))
vary_by_charset = 1;
}
! if ((len = find_content_length(neg, variant)) != 0) {
ap_snprintf(lenstr, sizeof(lenstr), "%ld", len);
rec = pstrcat(r->pool, rec, " {length ", lenstr, "}", NULL);
}
--- 1725,1731 ----
else if (strcmp(sample_charset, variant->content_charset))
vary_by_charset = 1;
}
! if ((len = (long)find_content_length(neg, variant)) != 0) {
ap_snprintf(lenstr, sizeof(lenstr), "%ld", len);
rec = pstrcat(r->pool, rec, " {length ", lenstr, "}", NULL);
}