mirror of
https://github.com/neovim/neovim.git
synced 2025-10-19 16:21:51 +00:00
vim-patch:8.1.2387: using old C style comments
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
2ab2e8608f
This commit is contained in:
@@ -794,8 +794,8 @@ void ex_hardcopy(exarg_T *eap)
|
|||||||
break; // reached the end
|
break; // reached the end
|
||||||
}
|
}
|
||||||
} else if (prtpos.ff) {
|
} else if (prtpos.ff) {
|
||||||
/* Line had a formfeed in it - start new page but
|
// Line had a formfeed in it - start new page but
|
||||||
* stay on the current line */
|
// stay on the current line
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1505,9 +1505,8 @@ static void prt_flush_buffer(void)
|
|||||||
prt_write_real(b / 255.0, 3);
|
prt_write_real(b / 255.0, 3);
|
||||||
prt_write_string("bg\n");
|
prt_write_string("bg\n");
|
||||||
}
|
}
|
||||||
/* Draw underlines before the text as it makes it slightly easier to
|
// Draw underlines before the text as it makes it slightly easier to
|
||||||
* find the starting point.
|
// find the starting point.
|
||||||
*/
|
|
||||||
if (prt_do_underline) {
|
if (prt_do_underline) {
|
||||||
if (prt_do_moveto) {
|
if (prt_do_moveto) {
|
||||||
prt_write_real(prt_pos_x_moveto, 2);
|
prt_write_real(prt_pos_x_moveto, 2);
|
||||||
@@ -1696,9 +1695,8 @@ static bool prt_next_dsc(struct prt_dsc_line_S *p_dsc_line)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Improved hand crafted parser to get the type, title, and version number of a
|
/// Improved hand crafted parser to get the type, title, and version number of a
|
||||||
* PS resource file so the file details can be added to the DSC header comments.
|
/// PS resource file so the file details can be added to the DSC header comments.
|
||||||
*/
|
|
||||||
static bool prt_open_resource(struct prt_ps_resource_S *resource)
|
static bool prt_open_resource(struct prt_ps_resource_S *resource)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
@@ -1906,9 +1904,8 @@ static void prt_dsc_font_resource(char *resource, struct prt_ps_font_S *ps_font)
|
|||||||
|
|
||||||
static void prt_dsc_requirements(int duplex, int tumble, int collate, int color, int num_copies)
|
static void prt_dsc_requirements(int duplex, int tumble, int collate, int color, int num_copies)
|
||||||
{
|
{
|
||||||
/* Only output the comment if we need to.
|
// Only output the comment if we need to.
|
||||||
* Note: tumble is ignored if we are not duplexing
|
// Note: tumble is ignored if we are not duplexing
|
||||||
*/
|
|
||||||
if (!(duplex || collate || color || (num_copies > 1))) {
|
if (!(duplex || collate || color || (num_copies > 1))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1967,10 +1964,9 @@ void mch_print_cleanup(void)
|
|||||||
if (prt_out_mbyte) {
|
if (prt_out_mbyte) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Free off all CID font names created, but first clear duplicate
|
// Free off all CID font names created, but first clear duplicate
|
||||||
* pointers to the same string (when the same font is used for more than
|
// pointers to the same string (when the same font is used for more than
|
||||||
* one style).
|
// one style).
|
||||||
*/
|
|
||||||
for (i = PRT_PS_FONT_ROMAN; i <= PRT_PS_FONT_BOLDOBLIQUE; i++) {
|
for (i = PRT_PS_FONT_ROMAN; i <= PRT_PS_FONT_BOLDOBLIQUE; i++) {
|
||||||
if (prt_ps_mb_font.ps_fontname[i] != NULL) {
|
if (prt_ps_mb_font.ps_fontname[i] != NULL) {
|
||||||
xfree(prt_ps_mb_font.ps_fontname[i]);
|
xfree(prt_ps_mb_font.ps_fontname[i]);
|
||||||
@@ -2048,9 +2044,8 @@ static int prt_get_cpl(void)
|
|||||||
{
|
{
|
||||||
if (prt_use_number()) {
|
if (prt_use_number()) {
|
||||||
prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width;
|
prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width;
|
||||||
/* If we are outputting multi-byte characters then line numbers will be
|
// If we are outputting multi-byte characters then line numbers will be
|
||||||
* printed with half width characters
|
// printed with half width characters
|
||||||
*/
|
|
||||||
if (prt_out_mbyte) {
|
if (prt_out_mbyte) {
|
||||||
prt_number_width /= 2;
|
prt_number_width /= 2;
|
||||||
}
|
}
|
||||||
@@ -2168,10 +2163,10 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
|||||||
p_encoding = enc_skip(p_enc);
|
p_encoding = enc_skip(p_enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for a multi-byte font that matches the encoding and character set.
|
// Look for a multi-byte font that matches the encoding and character set.
|
||||||
* Only look if multi-byte character set is defined, or using multi-byte
|
// Only look if multi-byte character set is defined, or using multi-byte
|
||||||
* encoding other than Unicode. This is because a Unicode encoding does not
|
// encoding other than Unicode. This is because a Unicode encoding does not
|
||||||
* uniquely identify a CJK character set to use. */
|
// uniquely identify a CJK character set to use.
|
||||||
p_mbenc = NULL;
|
p_mbenc = NULL;
|
||||||
props = enc_canon_props(p_encoding);
|
props = enc_canon_props(p_encoding);
|
||||||
if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) {
|
if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) {
|
||||||
@@ -2526,28 +2521,26 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
prt_dsc_textline("Orientation", "Portrait");
|
prt_dsc_textline("Orientation", "Portrait");
|
||||||
prt_dsc_atend("Pages");
|
prt_dsc_atend("Pages");
|
||||||
prt_dsc_textline("PageOrder", "Ascend");
|
prt_dsc_textline("PageOrder", "Ascend");
|
||||||
/* The bbox does not change with orientation - it is always in the default
|
// The bbox does not change with orientation - it is always in the default
|
||||||
* user coordinate system! We have to recalculate right and bottom
|
// user coordinate system! We have to recalculate right and bottom
|
||||||
* coordinates based on the font metrics for the bbox to be accurate. */
|
// coordinates based on the font metrics for the bbox to be accurate.
|
||||||
prt_page_margins(prt_mediasize[prt_media].width,
|
prt_page_margins(prt_mediasize[prt_media].width,
|
||||||
prt_mediasize[prt_media].height,
|
prt_mediasize[prt_media].height,
|
||||||
&left, &right, &top, &bottom);
|
&left, &right, &top, &bottom);
|
||||||
bbox[0] = (int)left;
|
bbox[0] = (int)left;
|
||||||
if (prt_portrait) {
|
if (prt_portrait) {
|
||||||
/* In portrait printing the fixed point is the top left corner so we
|
// In portrait printing the fixed point is the top left corner so we
|
||||||
* derive the bbox from that point. We have the expected cpl chars
|
// derive the bbox from that point. We have the expected cpl chars
|
||||||
* across the media and lpp lines down the media.
|
// across the media and lpp lines down the media.
|
||||||
*/
|
|
||||||
bbox[1] = (int)(top - (psettings->lines_per_page + prt_header_height())
|
bbox[1] = (int)(top - (psettings->lines_per_page + prt_header_height())
|
||||||
* prt_line_height);
|
* prt_line_height);
|
||||||
bbox[2] = (int)(left + psettings->chars_per_line * prt_char_width
|
bbox[2] = (int)(left + psettings->chars_per_line * prt_char_width
|
||||||
+ 0.5);
|
+ 0.5);
|
||||||
bbox[3] = (int)(top + 0.5);
|
bbox[3] = (int)(top + 0.5);
|
||||||
} else {
|
} else {
|
||||||
/* In landscape printing the fixed point is the bottom left corner so we
|
// In landscape printing the fixed point is the bottom left corner so we
|
||||||
* derive the bbox from that point. We have lpp chars across the media
|
// derive the bbox from that point. We have lpp chars across the media
|
||||||
* and cpl lines up the media.
|
// and cpl lines up the media.
|
||||||
*/
|
|
||||||
bbox[1] = (int)bottom;
|
bbox[1] = (int)bottom;
|
||||||
bbox[2] = (int)(left + ((psettings->lines_per_page
|
bbox[2] = (int)(left + ((psettings->lines_per_page
|
||||||
+ prt_header_height()) * prt_line_height) + 0.5);
|
+ prt_header_height()) * prt_line_height) + 0.5);
|
||||||
@@ -2597,11 +2590,10 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find an encoding to use for printing.
|
// Find an encoding to use for printing.
|
||||||
* Check 'printencoding'. If not set or not found, then use 'encoding'. If
|
// Check 'printencoding'. If not set or not found, then use 'encoding'. If
|
||||||
* that cannot be found then default to "latin1".
|
// that cannot be found then default to "latin1".
|
||||||
* Note: VIM specific encoding header is always skipped.
|
// Note: VIM specific encoding header is always skipped.
|
||||||
*/
|
|
||||||
if (!prt_out_mbyte) {
|
if (!prt_out_mbyte) {
|
||||||
p_encoding = enc_skip(p_penc);
|
p_encoding = enc_skip(p_penc);
|
||||||
if (*p_encoding == NUL
|
if (*p_encoding == NUL
|
||||||
@@ -2626,8 +2618,8 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
if (!prt_open_resource(&res_encoding)) {
|
if (!prt_open_resource(&res_encoding)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* For the moment there are no checks on encoding resource files to
|
// For the moment there are no checks on encoding resource files to
|
||||||
* perform */
|
// perform
|
||||||
} else {
|
} else {
|
||||||
p_encoding = enc_skip(p_penc);
|
p_encoding = enc_skip(p_penc);
|
||||||
if (*p_encoding == NUL) {
|
if (*p_encoding == NUL) {
|
||||||
@@ -2643,8 +2635,8 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
if (!prt_open_resource(&res_encoding)) {
|
if (!prt_open_resource(&res_encoding)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* For the moment there are no checks on encoding resource files to
|
// For the moment there are no checks on encoding resource files to
|
||||||
* perform */
|
// perform
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2742,8 +2734,8 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!prt_out_mbyte || prt_use_courier) {
|
if (!prt_out_mbyte || prt_use_courier) {
|
||||||
/* There will be only one Roman font encoding to be included in the PS
|
// There will be only one Roman font encoding to be included in the PS
|
||||||
* file. */
|
// file.
|
||||||
if (!prt_add_resource(&res_encoding)) {
|
if (!prt_add_resource(&res_encoding)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -2771,8 +2763,8 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
|
|
||||||
// Font resource inclusion and definition
|
// Font resource inclusion and definition
|
||||||
if (!prt_out_mbyte || prt_use_courier) {
|
if (!prt_out_mbyte || prt_use_courier) {
|
||||||
/* When using Courier for ASCII range when printing multi-byte, need to
|
// When using Courier for ASCII range when printing multi-byte, need to
|
||||||
* pick up ASCII encoding to use with it. */
|
// pick up ASCII encoding to use with it.
|
||||||
if (prt_use_courier) {
|
if (prt_use_courier) {
|
||||||
p_encoding = (char_u *)prt_ascii_encoding;
|
p_encoding = (char_u *)prt_ascii_encoding;
|
||||||
}
|
}
|
||||||
@@ -2794,12 +2786,11 @@ int mch_print_begin(prt_settings_T *psettings)
|
|||||||
prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
|
prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
|
||||||
}
|
}
|
||||||
if (prt_out_mbyte) {
|
if (prt_out_mbyte) {
|
||||||
/* Define the CID fonts to be used in the job. Typically CJKV fonts do
|
// Define the CID fonts to be used in the job. Typically CJKV fonts do
|
||||||
* not have an italic form being a western style, so where no font is
|
// not have an italic form being a western style, so where no font is
|
||||||
* defined for these faces VIM falls back to an existing face.
|
// defined for these faces VIM falls back to an existing face.
|
||||||
* Note: if using Courier for the ASCII range then the printout will
|
// Note: if using Courier for the ASCII range then the printout will
|
||||||
* have bold/italic/bolditalic regardless of the setting of printmbfont.
|
// have bold/italic/bolditalic regardless of the setting of printmbfont.
|
||||||
*/
|
|
||||||
prt_dsc_resources("IncludeResource", "font",
|
prt_dsc_resources("IncludeResource", "font",
|
||||||
prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
|
prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
|
||||||
if (!prt_custom_cmap) {
|
if (!prt_custom_cmap) {
|
||||||
@@ -2872,8 +2863,8 @@ void mch_print_end(prt_settings_T *psettings)
|
|||||||
|
|
||||||
prt_dsc_noarg("EOF");
|
prt_dsc_noarg("EOF");
|
||||||
|
|
||||||
/* Write CTRL-D to close serial communication link if used.
|
// Write CTRL-D to close serial communication link if used.
|
||||||
* NOTHING MUST BE WRITTEN AFTER THIS! */
|
// NOTHING MUST BE WRITTEN AFTER THIS!
|
||||||
prt_write_file((char_u *)"\004");
|
prt_write_file((char_u *)"\004");
|
||||||
|
|
||||||
if (!prt_file_error && psettings->outfile == NULL
|
if (!prt_file_error && psettings->outfile == NULL
|
||||||
@@ -2977,13 +2968,12 @@ int mch_print_text_out(char_u *const textp, size_t len)
|
|||||||
char_u *tofree = NULL;
|
char_u *tofree = NULL;
|
||||||
double char_width = prt_char_width;
|
double char_width = prt_char_width;
|
||||||
|
|
||||||
/* Ideally VIM would create a rearranged CID font to combine a Roman and
|
// Ideally VIM would create a rearranged CID font to combine a Roman and
|
||||||
* CJKV font to do what VIM is doing here - use a Roman font for characters
|
// CJKV font to do what VIM is doing here - use a Roman font for characters
|
||||||
* in the ASCII range, and the original CID font for everything else.
|
// in the ASCII range, and the original CID font for everything else.
|
||||||
* The problem is that GhostScript still (as of 8.13) does not support
|
// The problem is that GhostScript still (as of 8.13) does not support
|
||||||
* rearranged fonts even though they have been documented by Adobe for 7
|
// rearranged fonts even though they have been documented by Adobe for 7
|
||||||
* years! If they ever do, a lot of this code will disappear.
|
// years! If they ever do, a lot of this code will disappear.
|
||||||
*/
|
|
||||||
if (prt_use_courier) {
|
if (prt_use_courier) {
|
||||||
const bool in_ascii = (len == 1 && *p < 0x80);
|
const bool in_ascii = (len == 1 && *p < 0x80);
|
||||||
if (prt_in_ascii) {
|
if (prt_in_ascii) {
|
||||||
@@ -3020,9 +3010,8 @@ int mch_print_text_out(char_u *const textp, size_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Output any required changes to the graphics state, after flushing any
|
// Output any required changes to the graphics state, after flushing any
|
||||||
* text buffered so far.
|
// text buffered so far.
|
||||||
*/
|
|
||||||
if (prt_attribute_change) {
|
if (prt_attribute_change) {
|
||||||
prt_flush_buffer();
|
prt_flush_buffer();
|
||||||
// Reset count of number of chars that will be printed
|
// Reset count of number of chars that will be printed
|
||||||
@@ -3100,16 +3089,14 @@ int mch_print_text_out(char_u *const textp, size_t len)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Add next character to buffer of characters to output.
|
// Add next character to buffer of characters to output.
|
||||||
* Note: One printed character may require several PS characters to
|
// Note: One printed character may require several PS characters to
|
||||||
* represent it, but we only count them as one printed character.
|
// represent it, but we only count them as one printed character.
|
||||||
*/
|
|
||||||
ch = *p;
|
ch = *p;
|
||||||
if (ch < 32 || ch == '(' || ch == ')' || ch == '\\') {
|
if (ch < 32 || ch == '(' || ch == ')' || ch == '\\') {
|
||||||
/* Convert non-printing characters to either their escape or octal
|
// Convert non-printing characters to either their escape or octal
|
||||||
* sequence, ensures PS sent over a serial line does not interfere
|
// sequence, ensures PS sent over a serial line does not interfere
|
||||||
* with the comms protocol.
|
// with the comms protocol.
|
||||||
*/
|
|
||||||
ga_append(&prt_ps_buffer, '\\');
|
ga_append(&prt_ps_buffer, '\\');
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case BS:
|
case BS:
|
||||||
|
Reference in New Issue
Block a user