History

C/ML consistency/harmony

malc committed 5 years ago

Commit ae32b781 parent c4dbeda1 file · +19 −19Browse files

Unified · Split

link.c+19−19
@@ -52,10 +52,10 @@ enum { · 51 unmodified lines
5252 Cpage, Ctile, Ctrimset, Csettrim, Csliceh, Cinterrupt
5353 };
5454 enum { FitWidth, FitProportional, FitPage };
55−enum { dir_first, dir_last };
56−enum { dir_first_visible, dir_left, dir_right, dir_down, dir_up };
57−enum { uuri, utext, utextannot, ufileannot, unone };
58−enum { mark_page, mark_block, mark_line, mark_word };
55+enum { LDfirst, LDlast };
56+enum { LDfirstvisible, LDleft, LDright, LDdown, LDup };
57+enum { Uuri, Utext, Utextannot, Ufileannot, Unone };
58+enum { Mark_page, Mark_block, Mark_line, Mark_word };
5959
6060 struct slice {
6161 int h;
@@ -2330,7 +2330,7 @@ ML (findlink (value ptr_v, value dir_v)) · 2268 unmodified lines
23302330 if (Is_block (dir_v)) {
23312331 dirtag = Tag_val (dir_v);
23322332 switch (dirtag) {
2333− case dir_first_visible:
2333+ case LDfirstvisible:
23342334 {
23352335 int x0, y0, dir, first_index, last_index;
23362336
@@ -2359,7 +2359,7 @@ ML (findlink (value ptr_v, value dir_v)) · 22 unmodified lines
23592359 }
23602360 break;
23612361
2362− case dir_left:
2362+ case LDleft:
23632363 slinkindex = Int_val (Field (dir_v, 0));
23642364 found = &page->slinks[slinkindex];
23652365 for (i = slinkindex - 1; i >= 0; --i) {
@@ -2371,7 +2371,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
23712371 }
23722372 break;
23732373
2374− case dir_right:
2374+ case LDright:
23752375 slinkindex = Int_val (Field (dir_v, 0));
23762376 found = &page->slinks[slinkindex];
23772377 for (i = slinkindex + 1; i < page->slinkcount; ++i) {
@@ -2383,7 +2383,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
23832383 }
23842384 break;
23852385
2386− case dir_down:
2386+ case LDdown:
23872387 slinkindex = Int_val (Field (dir_v, 0));
23882388 found = &page->slinks[slinkindex];
23892389 for (i = slinkindex + 1; i < page->slinkcount; ++i) {
@@ -2395,7 +2395,7 @@ ML (findlink (value ptr_v, value dir_v)) · 5 unmodified lines
23952395 }
23962396 break;
23972397
2398− case dir_up:
2398+ case LDup:
23992399 slinkindex = Int_val (Field (dir_v, 0));
24002400 found = &page->slinks[slinkindex];
24012401 for (i = slinkindex - 1; i >= 0; --i) {
@@ -2411,11 +2411,11 @@ ML (findlink (value ptr_v, value dir_v)) · 9 unmodified lines
24112411 else {
24122412 dirtag = Int_val (dir_v);
24132413 switch (dirtag) {
2414− case dir_first:
2414+ case LDfirst:
24152415 found = page->slinks;
24162416 break;
24172417
2418− case dir_last:
2418+ case LDlast:
24192419 if (page->slinks) {
24202420 found = page->slinks + (page->slinkcount - 1);
24212421 }
@@ -2450,12 +2450,12 @@ ML (getlink (value ptr_v, value n_v)) · 28 unmodified lines
24502450 if (slink->tag == SLINK) {
24512451 link = slink->u.link;
24522452 str_v = caml_copy_string (link->uri);
2453− ret_v = caml_alloc_small (1, uuri);
2453+ ret_v = caml_alloc_small (1, Uuri);
24542454 Field (ret_v, 0) = str_v;
24552455 }
24562456 else {
24572457 int ty = pdf_annot_type (state.ctx, slink->u.annot)
2458− == PDF_ANNOT_FILE_ATTACHMENT ? ufileannot : utextannot;
2458+ == PDF_ANNOT_FILE_ATTACHMENT ? Ufileannot : Utextannot;
24592459
24602460 ret_v = caml_alloc_small (1, ty);
24612461 tup_v = caml_alloc_tuple (2);
@@ -2615,7 +2615,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 153 unmodified lines
26152615 }
26162616 }
26172617 ty = pdf_annot_type (state.ctx, annot->annot)
2618− == PDF_ANNOT_FILE_ATTACHMENT ? ufileannot : utextannot;
2618+ == PDF_ANNOT_FILE_ATTACHMENT ? Ufileannot : Utextannot;
26192619
26202620 ret_v = caml_alloc_small (1, ty);
26212621 tup_v = caml_alloc_tuple (2);
@@ -2628,7 +2628,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 6 unmodified lines
26282628 link = getlink (page, x, y);
26292629 if (link) {
26302630 str_v = caml_copy_string (link->uri);
2631− ret_v = caml_alloc_small (1, uuri);
2631+ ret_v = caml_alloc_small (1, Uuri);
26322632 Field (ret_v, 0) = str_v;
26332633 }
26342634 else {
@@ -2684,7 +2684,7 @@ ML (whatsunder (value ptr_v, value x_v, value y_v)) · 49 unmodified lines
26842684 if (str_v == Val_unit) {
26852685 str_v = caml_copy_string (n2);
26862686 }
2687− ret_v = caml_alloc_small (1, utext);
2687+ ret_v = caml_alloc_small (1, Utext);
26882688 Field (ret_v, 0) = str_v;
26892689 goto unlock;
26902690 }
@@ -2743,7 +2743,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 52 unmodified lines
27432743
27442744 ensuretext (page);
27452745
2746− if (mark == mark_page) {
2746+ if (mark == Mark_page) {
27472747 page->fmark = page->text->first_block->u.t.first_line->first_char;
27482748 page->lmark = page->text->last_block->u.t.last_line->last_char;
27492749 ret_v = Val_bool (1);
@@ -2761,7 +2761,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 11 unmodified lines
27612761 continue;
27622762 }
27632763
2764− if (mark == mark_block) {
2764+ if (mark == Mark_block) {
27652765 page->fmark = block->u.t.first_line->first_char;
27662766 page->lmark = block->u.t.last_line->last_char;
27672767 ret_v = Val_bool (1);
@@ -2775,7 +2775,7 @@ ML (markunder (value ptr_v, value x_v, value y_v, value mark_v)) · 7 unmodified lines
27752775 continue;
27762776 }
27772777
2778− if (mark == mark_line) {
2778+ if (mark == Mark_line) {
27792779 page->fmark = line->first_char;
27802780 page->lmark = line->last_char;
27812781 ret_v = Val_bool (1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t