如何在程序中初始化方法 [英] How to initialise method in the program
本文介绍了如何在程序中初始化方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
i在我的程序中有以下方法构建程序时
方法是未初始化的,就像错误显示一样
我有什么尝试在下面
hello,
i have below method in my program when build the program
method is uninitialised like that error is showing
what i have tried is below
METHODDEF(void)
put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied)
/* This version is for writing 24-bit pixels */
{
bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
JSAMPARRAY image_ptr;
register JSAMPROW inptr, outptr;
register JDIMENSION col;
int pad;
/* Access next row in virtual array */
image_ptr = (*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, dest->whole_image,
dest->cur_output_row, (JDIMENSION) 1, TRUE);
dest->cur_output_row++;
/* Transfer data. Note destination values must be in BGR order
* (even though Microsoft's own documents say the opposite).
*/
inptr = dest->pub.buffer[0];
outptr = image_ptr[0];
for (col = cinfo->output_width; col > 0; col--) {
outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */
outptr[1] = *inptr++;
outptr[0] = *inptr++;
outptr += 3;
}
/* Zero out the pad bytes. */
pad = dest->pad_bytes;
while (--pad >= 0)
*outptr++ = 0;
}
我的尝试:
What I have tried:
METHODDEF(void)
put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied)
/* This version is for writing 24-bit pixels */
{
bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
JSAMPARRAY image_ptr;
register JSAMPROW inptr, outptr;
register JDIMENSION col;
int pad;
/* Access next row in virtual array */
image_ptr = (*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, dest->whole_image,
dest->cur_output_row, (JDIMENSION) 1, TRUE);
dest->cur_output_row++;
/* Transfer data. Note destination values must be in BGR order
* (even though Microsoft's own documents say the opposite).
*/
inptr = dest->pub.buffer[0];
outptr = image_ptr[0];
for (col = cinfo->output_width; col > 0; col--) {
outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */
outptr[1] = *inptr++;
outptr[0] = *inptr++;
outptr += 3;
}
/* Zero out the pad bytes. */
pad = dest->pad_bytes;
while (--pad >= 0)
*outptr++ = 0;
}
推荐答案
方法不必初始化,变量必须。您可能在函数中有未初始化的变量。
无论如何,您应该研究(并可能在此报告)确切的错误消息:它包含用于查找有问题的行的有用信息。
Methods don't have to be initilalised, variables have to. You probably have uninitialised variable(s) in your function.
Anyway you should study (and possibly report here) the exact error message: it contains useful info for locating the offending line.
这篇关于如何在程序中初始化方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文