Commit 8d9bf23f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Don't use BOOL values to set bit fields.

parent f84eaad8
...@@ -1927,11 +1927,11 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s ...@@ -1927,11 +1927,11 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s
family_data->fonts[family_data->font_count] = font_data; family_data->fonts[family_data->font_count] = font_data;
family_data->font_count++; family_data->font_count++;
if (font_data->style == DWRITE_FONT_STYLE_NORMAL) if (font_data->style == DWRITE_FONT_STYLE_NORMAL)
family_data->has_normal_face = TRUE; family_data->has_normal_face = 1;
else if (font_data->style == DWRITE_FONT_STYLE_OBLIQUE) else if (font_data->style == DWRITE_FONT_STYLE_OBLIQUE)
family_data->has_oblique_face = TRUE; family_data->has_oblique_face = 1;
else else
family_data->has_italic_face = TRUE; family_data->has_italic_face = 1;
return S_OK; return S_OK;
} }
...@@ -2733,8 +2733,8 @@ static HRESULT init_font_data(IDWriteFactory2 *factory, IDWriteFontFile *file, D ...@@ -2733,8 +2733,8 @@ static HRESULT init_font_data(IDWriteFactory2 *factory, IDWriteFontFile *file, D
data->face_index = face_index; data->face_index = face_index;
data->face_type = face_type; data->face_type = face_type;
data->simulations = DWRITE_FONT_SIMULATIONS_NONE; data->simulations = DWRITE_FONT_SIMULATIONS_NONE;
data->bold_sim_tested = FALSE; data->bold_sim_tested = 0;
data->oblique_sim_tested = FALSE; data->oblique_sim_tested = 0;
IDWriteFontFile_AddRef(file); IDWriteFontFile_AddRef(file);
IDWriteFactory2_AddRef(factory); IDWriteFactory2_AddRef(factory);
...@@ -2811,9 +2811,9 @@ static HRESULT init_fontfamily_data(IDWriteLocalizedStrings *familyname, struct ...@@ -2811,9 +2811,9 @@ static HRESULT init_fontfamily_data(IDWriteLocalizedStrings *familyname, struct
data->ref = 1; data->ref = 1;
data->font_count = 0; data->font_count = 0;
data->font_alloc = 2; data->font_alloc = 2;
data->has_normal_face = FALSE; data->has_normal_face = 0;
data->has_oblique_face = FALSE; data->has_oblique_face = 0;
data->has_italic_face = FALSE; data->has_italic_face = 0;
data->fonts = heap_alloc(sizeof(*data->fonts)*data->font_alloc); data->fonts = heap_alloc(sizeof(*data->fonts)*data->font_alloc);
if (!data->fonts) { if (!data->fonts) {
...@@ -2839,7 +2839,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa ...@@ -2839,7 +2839,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa
if (family->fonts[i]->bold_sim_tested) if (family->fonts[i]->bold_sim_tested)
continue; continue;
family->fonts[i]->bold_sim_tested = TRUE; family->fonts[i]->bold_sim_tested = 1;
for (j = i; j < family->font_count; j++) { for (j = i; j < family->font_count; j++) {
if (family->fonts[j]->bold_sim_tested) if (family->fonts[j]->bold_sim_tested)
continue; continue;
...@@ -2850,7 +2850,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa ...@@ -2850,7 +2850,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa
weight = family->fonts[j]->weight; weight = family->fonts[j]->weight;
heaviest = j; heaviest = j;
} }
family->fonts[j]->bold_sim_tested = TRUE; family->fonts[j]->bold_sim_tested = 1;
} }
} }
...@@ -2892,7 +2892,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa ...@@ -2892,7 +2892,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa
strcatW(facenameW, boldW); strcatW(facenameW, boldW);
if (init_font_data_from_font(family->fonts[heaviest], DWRITE_FONT_SIMULATIONS_BOLD, facenameW, &boldface) == S_OK) { if (init_font_data_from_font(family->fonts[heaviest], DWRITE_FONT_SIMULATIONS_BOLD, facenameW, &boldface) == S_OK) {
boldface->bold_sim_tested = TRUE; boldface->bold_sim_tested = 1;
fontfamily_add_font(family, boldface); fontfamily_add_font(family, boldface);
} }
} }
...@@ -2911,7 +2911,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data ...@@ -2911,7 +2911,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data
if (family->fonts[i]->oblique_sim_tested) if (family->fonts[i]->oblique_sim_tested)
continue; continue;
family->fonts[i]->oblique_sim_tested = TRUE; family->fonts[i]->oblique_sim_tested = 1;
if (family->fonts[i]->style == DWRITE_FONT_STYLE_NORMAL) if (family->fonts[i]->style == DWRITE_FONT_STYLE_NORMAL)
regular = i; regular = i;
else if (family->fonts[i]->style == DWRITE_FONT_STYLE_OBLIQUE) else if (family->fonts[i]->style == DWRITE_FONT_STYLE_OBLIQUE)
...@@ -2925,7 +2925,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data ...@@ -2925,7 +2925,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data
if ((family->fonts[i]->weight == family->fonts[j]->weight) && if ((family->fonts[i]->weight == family->fonts[j]->weight) &&
(family->fonts[i]->stretch == family->fonts[j]->stretch)) { (family->fonts[i]->stretch == family->fonts[j]->stretch)) {
family->fonts[j]->oblique_sim_tested = TRUE; family->fonts[j]->oblique_sim_tested = 1;
if (regular == ~0 && family->fonts[j]->style == DWRITE_FONT_STYLE_NORMAL) if (regular == ~0 && family->fonts[j]->style == DWRITE_FONT_STYLE_NORMAL)
regular = j; regular = j;
...@@ -2956,7 +2956,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data ...@@ -2956,7 +2956,7 @@ static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data
strcatW(facenameW, obliqueW); strcatW(facenameW, obliqueW);
if (init_font_data_from_font(family->fonts[regular], DWRITE_FONT_SIMULATIONS_OBLIQUE, facenameW, &obliqueface) == S_OK) { if (init_font_data_from_font(family->fonts[regular], DWRITE_FONT_SIMULATIONS_OBLIQUE, facenameW, &obliqueface) == S_OK) {
obliqueface->oblique_sim_tested = TRUE; obliqueface->oblique_sim_tested = 1;
fontfamily_add_font(family, obliqueface); fontfamily_add_font(family, obliqueface);
} }
} }
......
...@@ -568,8 +568,8 @@ static HRESULT layout_update_breakpoints_range(struct dwrite_textlayout *layout, ...@@ -568,8 +568,8 @@ static HRESULT layout_update_breakpoints_range(struct dwrite_textlayout *layout,
layout->actual_breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_MAY_NOT_BREAK; layout->actual_breakpoints[i].breakConditionAfter = DWRITE_BREAK_CONDITION_MAY_NOT_BREAK;
} }
layout->actual_breakpoints[i].isWhitespace = FALSE; layout->actual_breakpoints[i].isWhitespace = 0;
layout->actual_breakpoints[i].isSoftHyphen = FALSE; layout->actual_breakpoints[i].isSoftHyphen = 0;
} }
return S_OK; return S_OK;
...@@ -797,11 +797,11 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) ...@@ -797,11 +797,11 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
metrics->width = 0.0f; metrics->width = 0.0f;
metrics->length = r->u.object.length; metrics->length = r->u.object.length;
metrics->canWrapLineAfter = FALSE; metrics->canWrapLineAfter = 0;
metrics->isWhitespace = FALSE; metrics->isWhitespace = 0;
metrics->isNewline = FALSE; metrics->isNewline = 0;
metrics->isSoftHyphen = FALSE; metrics->isSoftHyphen = 0;
metrics->isRightToLeft = FALSE; metrics->isRightToLeft = 0;
metrics->padding = 0; metrics->padding = 0;
c->run = r; c->run = r;
c->position = 0; /* there's always one cluster per inline object, so 0 is valid value */ c->position = 0; /* there's always one cluster per inline object, so 0 is valid value */
...@@ -931,7 +931,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) ...@@ -931,7 +931,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
if (hr == S_OK) { if (hr == S_OK) {
layout->cluster_count = cluster; layout->cluster_count = cluster;
if (cluster) if (cluster)
layout->clustermetrics[cluster-1].canWrapLineAfter = TRUE; layout->clustermetrics[cluster-1].canWrapLineAfter = 1;
} }
IDWriteTextAnalyzer_Release(analyzer); IDWriteTextAnalyzer_Release(analyzer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment