Opened 3 years ago

Closed 3 years ago

#262 closed ожидается проверка (задача сдана)

HW #1 (BMP) Martynov hw_01

Reported by: martynov.maksim Owned by: Антон Филатов
Component: HW #1 (BMP) Version: 2.0
Keywords: Cc:

Description

Выравнивание прикрутить не успел, поэтому должно нормально работать только со сторонами, делящимися на 4. Еще делаю много mallocов, потом поправлю.

Change History (3)

comment:1 Changed 3 years ago by Антон Филатов

Type: ожидается проверкаожидаются исправления
make
if [ ! -d "obj" ]; then mkdir "obj"; fi
gcc -c -Wall -Wextra -Werror src/bmp.c -o obj/bmp.o -I include
In file included from src/bmp.c:1:0:
include/bmp.h:9:5: error: unknown type name ‘uint16_t’
     uint16_t bfType;  //specifies the file type
     ^~~~~~~~
include/bmp.h:10:5: error: unknown type name ‘uint32_t’
     uint32_t bfSize;  //specifies the size in bytes of the bitmap file
     ^~~~~~~~
include/bmp.h:11:5: error: unknown type name ‘uint16_t’
     uint16_t bfReserved1;  //reserved; must be 0
     ^~~~~~~~
include/bmp.h:12:5: error: unknown type name ‘uint16_t’
     uint16_t bfReserved2;  //reserved; must be 0
     ^~~~~~~~
include/bmp.h:13:5: error: unknown type name ‘uint32_t’
     uint32_t  bfOffBits;  //species the offset in bytes from the bitmapfileheader to the bitmap bits
     ^~~~~~~~
include/bmp.h:17:5: error: unknown type name ‘uint32_t’
     uint32_t biSize;  //specifies the number of bytes required by the struct
     ^~~~~~~~
include/bmp.h:20:5: error: unknown type name ‘uint16_t’
     uint16_t biPlanes; //specifies the number of color planes, must be 1
     ^~~~~~~~
include/bmp.h:21:5: error: unknown type name ‘uint16_t’
     uint16_t biBitCount; //specifies the number of bit per pixel
     ^~~~~~~~
include/bmp.h:22:5: error: unknown type name ‘uint32_t’
     uint32_t biCompression;//spcifies the type of compression
     ^~~~~~~~
include/bmp.h:23:5: error: unknown type name ‘uint32_t’
     uint32_t biSizeImage;  //size of image in bytes
     ^~~~~~~~
include/bmp.h:26:5: error: unknown type name ‘uint32_t’
     uint32_t biClrUsed;  //number of colors used by th ebitmap
     ^~~~~~~~
include/bmp.h:27:5: error: unknown type name ‘uint32_t’
     uint32_t biClrImportant;  //number of colors that are important
     ^~~~~~~~
Makefile:7: recipe for target 'obj/bmp.o' failed
make: *** [obj/bmp.o] Error 1

Пофиксил, но у вас всё равно тесты падают, даже там, где строка делится на 4.
Начнём с простого - вы везде не изменяете filesize в заголовках - а следовало бы.
В тесте на лену с параметрами 25 50 130 130 - делаете что-то неправильное. Тут на 4 стороны не делятся, понятно

Стиль:

  • с маллоками у вас не всё так плохо, но если сможете сократить - будет только лучше
  • проверьте, что у вас везде const стоит, где ему положено в аргументах функций
  • а вы намеренно на rotate выделяете новую память? В теории можно обойтись почти без новой памяти (это не обязательное требование, за это замечание баллов я снимать не буду)

Корректность: 5/20
Стиль: 8/10

comment:2 Changed 3 years ago by martynov.maksim

Type: ожидаются исправленияожидается проверка
Version: 1.02.0

В bmp.h добавил #include <stdint.h>, теперь, надеюсь, у вас сразу запустится

comment:3 Changed 3 years ago by Антон Филатов

Resolution: задача сдана
Status: assignedclosed

Везде всё правильно, но есть одно но: вы везде запороли третий байт. Там где size лежит.
За исключением этого все тесты проходят.
Так что 15/20 за корректность
Стиль: 10/10

Note: See TracTickets for help on using tickets.