Lines Matching refs:num_lines
1513 static SANE_Status read_calibration_data (SnapScan_Scanner *pss, void *buf, u_char num_lines)
1517 size_t expected_read_bytes = num_lines * calibration_line_length(pss);
1524 pss->cmd[5] = num_lines;
1562 int num_lines = pss->phys_buf_sz / line_length;
1563 if (num_lines > NUM_CALIBRATION_LINES)
1565 num_lines = NUM_CALIBRATION_LINES;
1566 } else if (num_lines == 0)
1571 buf = (u_char *) malloc(num_lines * line_length);
1574 DBG (DL_MAJOR_ERROR, "%s: out of memory allocating calibration, %d bytes.", me, num_lines * line_length);
1578 DBG (DL_MAJOR_ERROR, "%s: reading calibration data (%d lines)\n", me, num_lines);
1579 status = read_calibration_data(pss, buf, num_lines);
1584 for(r=0; r < num_lines; r++) {
1587 pss->buf[c + SEND_LENGTH] = sum / num_lines;