GithubHelp home page GithubHelp logo

Inconsistent types for line numbers about klogg HOT 2 CLOSED

variar avatar variar commented on September 25, 2024
Inconsistent types for line numbers

from klogg.

Comments (2)

variar avatar variar commented on September 25, 2024

Opening files with more than UINT32_MAX is broken in klogg as well as upstream. Index builds fine, but line number counter overflows.

from klogg.

variar avatar variar commented on September 25, 2024

Klogg uses QString::length and QTextCodec::toUnicode to handle individual strings. So there will be no support for files that have lines with more than 2147483647 characters.

I've decided to keep original limit for total number of lines in file. Files with more than 4294967295 lines will not be displayed correctly.

Klogg uses QIODevice interface to read data from filesystem. This implies that maximum supported file size is 9223372036854775807 bytes (~9223 petabytes). It seems very unlikely to cause any trouble.

I've used stong typing technique from Fluent C++ to express line related types in code (line number, line length, offset and count). This prevents from accidentally passing wrong type (for example, line number instead of number of lines) and allows to limit operations on that types (adding line numbers is not allowed, subtracting line numbers produces a number of lines, but line number can be incremented/decremented etc.).

I hope more old bugs were fixed during this refactoring that introduced.

from klogg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.