summaryrefslogtreecommitdiff
path: root/backend/genesys/genesys.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
commit9f8889f928ce86ba4a78659d378c6ba29bc9f735 (patch)
treec9567cb0d015b68ce3da8d03472b6443f1cb1ca9 /backend/genesys/genesys.cpp
parent446e9454b8cbe5b689149415d11d36e88442ca88 (diff)
parent154785ab2d5df7ddc8c2cf813b773c340e5e2aea (diff)
Merge branch 'release/debian/1.0.32-1'debian/1.0.32-1
Diffstat (limited to 'backend/genesys/genesys.cpp')
-rw-r--r--backend/genesys/genesys.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/backend/genesys/genesys.cpp b/backend/genesys/genesys.cpp
index 9d80cfa..9552fa9 100644
--- a/backend/genesys/genesys.cpp
+++ b/backend/genesys/genesys.cpp
@@ -28,9 +28,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
@@ -389,7 +387,7 @@ void sanei_genesys_create_default_gamma_table(Genesys_Device* dev,
TODO: Should also consider maximum transfer rate: ~6.5MB/s.
Note: The enhance option of the scanners does _not_ help. It only halves
- the amount of pixels transfered.
+ the amount of pixels transferred.
*/
SANE_Int sanei_genesys_exposure_time2(Genesys_Device * dev, const MotorProfile& profile, float ydpi,
int endpixel, int exposure_by_led)
@@ -3204,7 +3202,7 @@ compute_shifted_coefficients (Genesys_Device * dev,
unsigned int coeff,
unsigned int target_dark,
unsigned int target_bright,
- unsigned int patch_size) /* contigous extent */
+ unsigned int patch_size) /* contiguous extent */
{
unsigned int x, avgpixels, basepixels, i, j, val1, val2;
unsigned int br_tmp [3], dk_tmp [3];
@@ -3573,7 +3571,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
coeff,
0x0001, /* target_dark */
0xf900, /* target_bright */
- 256); /* patch_size: contigous extent */
+ 256); /* patch_size: contiguous extent */
break;
default:
throw SaneException(SANE_STATUS_UNSUPPORTED, "sensor %d not supported",
@@ -3598,7 +3596,7 @@ genesys_restore_calibration(Genesys_Device * dev, Genesys_Sensor& sensor)
{
DBG_HELPER(dbg);
- // if no cache or no function to evaluate cache entry ther can be no match/
+ // if no cache or no function to evaluate cache entry there can be no match/
if (dev->calibration_cache.empty()) {
return false;
}
@@ -4061,7 +4059,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off)
unsigned int steps, expected;
- /* since not all scanners are set ot wait for head to park
+ /* since not all scanners are set to wait for head to park
* we check we are not still parking before starting a new scan */
if (dev->parking) {
sanei_genesys_wait_for_home(dev);
@@ -4166,7 +4164,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off)
return;
}
- /*do we really need this? the valid data check should be sufficent -- pierre*/
+ /*do we really need this? the valid data check should be sufficient -- pierre*/
/* waits for head to reach scanning position */
expected = dev->reg.get8(0x3d) * 65536
+ dev->reg.get8(0x3e) * 256
@@ -4214,7 +4212,7 @@ static void genesys_read_ordered_data(Genesys_Device* dev, SANE_Byte* destinatio
/* is there data left to scan */
if (dev->total_bytes_read >= dev->total_bytes_to_read)
{
- /* issue park command immediatly in case scanner can handle it
+ /* issue park command immediately in case scanner can handle it
* so we save time */
if (!dev->model->is_sheetfed && !has_flag(dev->model->flags, ModelFlag::MUST_WAIT) &&
!dev->parking)
@@ -4374,7 +4372,7 @@ static Genesys_Settings calculate_scan_settings(Genesys_Scanner* s)
settings.true_gray = 0;
}
- // brigthness and contrast only for for 8 bit scans
+ // brightness and contrast only for for 8 bit scans
if (s->bit_depth == 8) {
settings.contrast = (s->contrast * 127) / 100;
settings.brightness = (s->brightness * 127) / 100;
@@ -4479,7 +4477,7 @@ static SANE_Range create_range(float size)
/** @brief generate calibration cache file nam
* Generates the calibration cache file name to use.
- * Tries to store the chache in $HOME/.sane or
+ * Tries to store the cache in $HOME/.sane or
* then fallbacks to $TMPDIR or TMP. The filename
* uses the model name if only one scanner is plugged
* else is uses the device name when several identical
@@ -4864,7 +4862,7 @@ static void init_options(Genesys_Scanner* s)
s->opt[OPT_CALIBRATION_FILE].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED;
s->opt[OPT_CALIBRATION_FILE].constraint_type = SANE_CONSTRAINT_NONE;
s->calibration_file.clear();
- /* disable option if ran as root */
+ /* disable option if run as root */
#ifdef HAVE_GETUID
if(geteuid()==0)
{
@@ -5186,7 +5184,8 @@ static SANE_Status attach_one_device(SANE_String_Const devname) noexcept
// this function is passed to C API, it must not throw
static SANE_Status
-config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname) noexcept
+config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname,
+ void __sane_unused__ *data) noexcept
{
/* the devname has been processed and is ready to be used
* directly. Since the backend is an USB only one, we can
@@ -5214,7 +5213,8 @@ static void probe_genesys_devices()
config.values = nullptr;
config.count = 0;
- auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config, config_attach_genesys);
+ auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config,
+ config_attach_genesys, NULL);
if (status == SANE_STATUS_ACCESS_DENIED) {
dbg.vlog(DBG_error0, "Critical error: Couldn't access configuration file '%s'",
GENESYS_CONFIG_FILE);
@@ -5346,7 +5346,7 @@ void sane_init_impl(SANE_Int * version_code, SANE_Auth_Callback authorize)
#endif
);
- // cold-plug case :detection of allready connected scanners
+ // cold-plug case :detection of already connected scanners
s_attach_device_by_name_evaluate_bcd_device = false;
probe_genesys_devices();
}
@@ -6333,7 +6333,7 @@ SANE_Status sane_read_impl(SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len
{
DBG(DBG_proc, "%s: nothing more to scan: EOF\n", __func__);
- /* issue park command immediatly in case scanner can handle it
+ /* issue park command immediately in case scanner can handle it
* so we save time */
if (!dev->model->is_sheetfed && !has_flag(dev->model->flags, ModelFlag::MUST_WAIT) &&
!dev->parking)