summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-07-27 22:43:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-07-27 22:49:24 (GMT)
commitd9c8eaac961b6fa097b362b2202c176a5ef16ec2 (patch)
treeba4572719bd7b2f84d7e06e59fbacfcfddc4ddde /src/glibext
parent703e0d10d56bb288b515526f0d0f1994391619bf (diff)
Replaced all BLC_* constants by the new DLC_* values.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/bufferline.c11
-rw-r--r--src/glibext/bufferline.h2
-rw-r--r--src/glibext/gbinportion.c4
-rw-r--r--src/glibext/generators/prologue.c5
-rw-r--r--src/glibext/generators/rborder.c4
-rw-r--r--src/glibext/widthtracker.c12
6 files changed, 20 insertions, 18 deletions
diff --git a/src/glibext/bufferline.c b/src/glibext/bufferline.c
index ec1176b..b5fe7ed 100644
--- a/src/glibext/bufferline.c
+++ b/src/glibext/bufferline.c
@@ -351,6 +351,7 @@ void g_buffer_line_fill_virt(GBufferLine *line, size_t col, MemoryDataSize size,
/******************************************************************************
* *
* Paramètres : line = ligne à venir compléter. *
+* col = indice de la colonne à constituer. *
* content = contenu binaire global à venir lire. *
* range = localisation des données à venir lire et présenter.*
* max = taille maximale de la portion binaire en octets. *
@@ -363,7 +364,7 @@ void g_buffer_line_fill_virt(GBufferLine *line, size_t col, MemoryDataSize size,
* *
******************************************************************************/
-void g_buffer_line_fill_content(GBufferLine *line, const GBinContent *content, const mrange_t *range, phys_t max)
+void g_buffer_line_fill_content(GBufferLine *line, size_t col, const GBinContent *content, const mrange_t *range, phys_t max)
{
phys_t length; /* Taille de la couverture */
bool truncated; /* Indique si le code est coupé*/
@@ -436,7 +437,7 @@ void g_buffer_line_fill_content(GBufferLine *line, const GBinContent *content, c
/* Conclusion */
- g_buffer_line_append_text(line, BLC_BINARY, bin_code, iter - bin_code, RTT_RAW_CODE, NULL);
+ g_buffer_line_append_text(line, col, bin_code, iter - bin_code, RTT_RAW_CODE, NULL);
if (bin_code != static_buffer)
free(bin_code);
@@ -462,7 +463,7 @@ GObject *g_buffer_line_find_first_segment_creator(const GBufferLine *line, Buffe
GObject *result; /* Trouvaille à retourner */
size_t i; /* Boucle de parcours */
- assert(column < BLC_COUNT);
+ assert(column < line->col_count);
result = NULL;
@@ -946,7 +947,7 @@ line_segment *g_buffer_line_get_segment_from_coord(const GBufferLine *line, cons
{
line_segment *result; /* Trouvaille à retourner */
- if (coord->column < BLC_COUNT)
+ if (coord->column < line->col_count)
result = get_line_column_content_from_index(&line->columns[coord->column], coord->index);
else
result = NULL;
@@ -994,7 +995,7 @@ bool g_buffer_line_get_coord_at(const GBufferLine *line, size_t index, GWidthTra
*base = 0;
- last = BLC_COUNT;
+ last = line->col_count;
last_base = 0;
/* On cible déjà la colonne idéale */
diff --git a/src/glibext/bufferline.h b/src/glibext/bufferline.h
index 319f9b7..f21c5d1 100644
--- a/src/glibext/bufferline.h
+++ b/src/glibext/bufferline.h
@@ -103,7 +103,7 @@ void g_buffer_line_fill_phys(GBufferLine *, size_t, MemoryDataSize, const vmpa2t
void g_buffer_line_fill_virt(GBufferLine *, size_t, MemoryDataSize, const vmpa2t *);
/* Construit le tronc commun d'une ligne autour de son contenu. */
-void g_buffer_line_fill_content(GBufferLine *, const GBinContent *, const mrange_t *, phys_t);
+void g_buffer_line_fill_content(GBufferLine *, size_t, const GBinContent *, const mrange_t *, phys_t);
/* Recherche le premier créateur enregistré dans des segments. */
GObject *g_buffer_line_find_first_segment_creator(const GBufferLine *, BufferLineColumn);
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 670e0ec..884c31d 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -1128,9 +1128,9 @@ static void g_binary_portion_print(GBinPortion *portion, GBufferLine *line, size
if (portion->text[repeat] != NULL)
{
- g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_LABEL);
+ g_buffer_line_start_merge_at(line, DLC_ASSEMBLY_LABEL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_LABEL, SL(portion->text[repeat]), RTT_COMMENT, NULL);
+ g_buffer_line_append_text(line, DLC_ASSEMBLY_LABEL, SL(portion->text[repeat]), RTT_COMMENT, NULL);
}
diff --git a/src/glibext/generators/prologue.c b/src/glibext/generators/prologue.c
index 5829fde..e19107b 100644
--- a/src/glibext/generators/prologue.c
+++ b/src/glibext/generators/prologue.c
@@ -33,6 +33,7 @@
#include "../linegen-int.h"
#include "../linesegment.h"
#include "../../format/executable.h"
+#include "../../gtkext/gtkblockdisplay.h"
@@ -380,9 +381,9 @@ static void g_intro_generator_print(GIntroGenerator *generator, GBufferLine *lin
if ((repeat + 1) != generator->count)
{
- g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_buffer_line_start_merge_at(line, DLC_PHYSICAL);
- g_buffer_line_append_text(line, BLC_PHYSICAL, SL(generator->text[repeat]), RTT_COMMENT, NULL);
+ g_buffer_line_append_text(line, DLC_PHYSICAL, SL(generator->text[repeat]), RTT_COMMENT, NULL);
if (repeat == 0)
g_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
diff --git a/src/glibext/generators/rborder.c b/src/glibext/generators/rborder.c
index 42ffc23..97e7a22 100644
--- a/src/glibext/generators/rborder.c
+++ b/src/glibext/generators/rborder.c
@@ -367,8 +367,8 @@ static void g_border_generator_print(GBorderGenerator *generator, GBufferLine *l
text = strdup(generator->start ? ROUTINE_INTRO_MSG : ROUTINE_OUTRO_MSG);
g_coding_language_encapsulate_comment(generator->lang, &text);
- g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_LABEL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_LABEL, SL(text), RTT_COMMENT, NULL);
+ g_buffer_line_start_merge_at(line, DLC_ASSEMBLY_LABEL);
+ g_buffer_line_append_text(line, DLC_ASSEMBLY_LABEL, SL(text), RTT_COMMENT, NULL);
free(text);
diff --git a/src/glibext/widthtracker.c b/src/glibext/widthtracker.c
index f0e2068..a3c8cba 100644
--- a/src/glibext/widthtracker.c
+++ b/src/glibext/widthtracker.c
@@ -329,7 +329,7 @@ static void g_width_update_process(GWidthUpdate *update, GtkStatusStack *status)
{
summary = g_width_tracker_get_up_to_date_widths(update->tracker, i);
- for (k = 0; k < BLC_COUNT; k++)
+ for (k = 0; k < update->tracker->col_count; k++)
local->max_widths[k] = MAX(local->max_widths[k], summary->max_widths[k]);
local->merged_width = MAX(local->merged_width, summary->merged_width);
@@ -361,7 +361,7 @@ static void g_width_update_collect(GWidthUpdate *update, line_width_summary *glo
local = &update->summary;
- for (i = 0; i < BLC_COUNT; i++)
+ for (i = 0; i < update->tracker->col_count; i++)
global->max_widths[i] = MAX(global->max_widths[i], local->max_widths[i]);
global->merged_width = MAX(global->merged_width, local->merged_width);
@@ -718,7 +718,7 @@ static void g_width_tracker_reset_widths(GWidthTracker *tracker, size_t index)
if (portion->cached)
{
- for (k = 0; k < BLC_COUNT && tracker->cached; k++)
+ for (k = 0; k < tracker->col_count && tracker->cached; k++)
tracker->cached &= (tracker->summary.max_widths[k] != portion->summary.max_widths[k]);
tracker->cached &= (tracker->summary.merged_width != portion->summary.merged_width);
@@ -1163,7 +1163,7 @@ static void g_width_tracker_ensure_valid_required_widths(GWidthTracker *tracker)
{
summary = g_width_tracker_get_up_to_date_widths(tracker, i);
- for (k = 0; k < BLC_COUNT; k++)
+ for (k = 0; k < tracker->col_count; k++)
global->max_widths[k] = MAX(global->max_widths[k], summary->max_widths[k]);
global->merged_width = MAX(global->merged_width, summary->merged_width);
@@ -1212,7 +1212,7 @@ gint g_width_tracker_get_width(GWidthTracker *tracker, const GDisplayOptions *op
/* Première méthode */
- for (i = 0; i < BLC_COUNT; i++)
+ for (i = 0; i < tracker->col_count; i++)
{
if (i < count)
{
@@ -1222,7 +1222,7 @@ gint g_width_tracker_get_width(GWidthTracker *tracker, const GDisplayOptions *op
col_width += summary->max_widths[i];
- if ((i + 1) < BLC_COUNT)
+ if ((i + 1) < tracker->col_count)
col_width += COL_MARGIN;
}