Author Topic: Nspire I/O  (Read 37416 times)

0 Members and 1 Guest are viewing this topic.

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Nspire I/O
« Reply #45 on: March 18, 2013, 12:03:49 pm »
Small update:

- Added double buffering (nio_scrbuf_* functions in nspireio-platform-nspire.h)
- Fixed a grayscale display issue (white was shown as gray)

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Nspire I/O
« Reply #46 on: September 28, 2013, 12:00:03 pm »
Feature request derived from http://ourl.ca/19674/362209 , assuming it doesn't exist yet: add nio_getsn() and add a compiler warning upon usage of nio_gets(). gets() is insecure and was removed from the C11 standard :)

When arg is a fixed-size char array, nio_gets can be expressed in terms of nio_getsn:
#define nio_gets(arg) nio_getsn(arg, sizeof(arg))
When arg is a pointer for an allocated array, that does not work...
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Legimet

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +29/-0
    • View Profile
Re: Nspire I/O
« Reply #47 on: September 28, 2013, 10:33:28 pm »
Actually, nio_gets() just calls nio_fgets() with a size argument of 100, so it's not insecure if you have a buffer of at least 100 chars, but it doesn't work like the gets function in older C standards.
If your buffer is smaller than 100 chars, you must use nio_fgets unless you want buffer overflows.

Another feature request: add nio_scanf() and nio_fscanf(). (Unfortunately, these will have to be implemented as macros, because there is no vsscanf syscall, only sscanf.)

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Nspire I/O
« Reply #48 on: September 29, 2013, 10:59:00 am »
I have added nio_scanf and nio_fscanf ;)

add nio_getsn() and add a compiler warning upon usage of nio_gets(). gets() is insecure and was removed from the C11 standard :)
Since we have fgets with a size argument, I don't think we need getsn.

Offline Legimet

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +29/-0
    • View Profile
Re: Nspire I/O
« Reply #49 on: September 29, 2013, 12:47:36 pm »
Thanks. And do you have any idea of when the next version will be released?
« Last Edit: September 29, 2013, 12:47:48 pm by Legimet »

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Nspire I/O
« Reply #50 on: September 29, 2013, 01:57:38 pm »
Probably when I continue working on the C++ support (holidays start in some days, so maybe I'll stop being lazy and work on some Nspire stuff again :P ).

Offline ivelegacy

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Nspire I/O
« Reply #51 on: September 22, 2016, 06:23:36 am »
I can't access the repository, it seems expired  :o

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Nspire I/O
« Reply #52 on: September 22, 2016, 11:26:04 am »
I can't access the repository, it seems expired  :o
From what I can see on the network graph, it was merged into master here: https://github.com/compujuckel/nspire-io/commit/43d991c2ce0bf6384cc5b24614e317f26467a2d2
/e

Offline ivelegacy

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Nspire I/O
« Reply #53 on: September 25, 2016, 09:51:20 am »
thanks, I will check it