mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
data types: use unified type name uint8_t instead u_int8_t
This commit is contained in:
@@ -29,7 +29,7 @@ Basic attributes and member functions for component sub classes
|
||||
#ifndef __N_COMPONENTS__
|
||||
#define __N_COMPONENTS__
|
||||
|
||||
#include <sys/types.h> /* crazy "u_int8_t" instead of plain uint8_t */
|
||||
|
||||
#include "cc_types.h"
|
||||
#include "cc_base.h"
|
||||
#include "cc_extra.h"
|
||||
|
@@ -368,7 +368,7 @@ bool CComponentsForm::isPageChanged()
|
||||
return false;
|
||||
}
|
||||
|
||||
void CComponentsForm::paintPage(const u_int8_t& page_number, bool do_save_bg)
|
||||
void CComponentsForm::paintPage(const uint8_t& page_number, bool do_save_bg)
|
||||
{
|
||||
cur_page = page_number;
|
||||
paint(do_save_bg);
|
||||
@@ -545,24 +545,24 @@ void CComponentsForm::hideCCItems()
|
||||
v_cc_items[i]->hide();
|
||||
}
|
||||
|
||||
void CComponentsForm::setPageCount(const u_int8_t& pageCount)
|
||||
void CComponentsForm::setPageCount(const uint8_t& pageCount)
|
||||
{
|
||||
u_int8_t new_val = pageCount;
|
||||
uint8_t new_val = pageCount;
|
||||
if (new_val < page_count)
|
||||
dprintf(DEBUG_NORMAL, "[CComponentsForm] %s: current count (= %u) of pages higher than page_count (= %u) will be set, smaller value is ignored!\n", __func__, page_count, new_val) ;
|
||||
page_count = max(new_val, page_count);
|
||||
}
|
||||
|
||||
u_int8_t CComponentsForm::getPageCount()
|
||||
uint8_t CComponentsForm::getPageCount()
|
||||
{
|
||||
u_int8_t num = 0;
|
||||
uint8_t num = 0;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||
u_int8_t item_num = v_cc_items[i]->getPageNumber();
|
||||
uint8_t item_num = v_cc_items[i]->getPageNumber();
|
||||
num = max(item_num, num);
|
||||
}
|
||||
|
||||
//convert type, possible -Wconversion warnings!
|
||||
page_count = static_cast<u_int8_t>(num+1);
|
||||
page_count = static_cast<uint8_t>(num+1);
|
||||
|
||||
return page_count;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#define __CC_FORM_H__
|
||||
|
||||
|
||||
#include <sys/types.h> /* crazy "u_int8_t" instead of plain uint8_t */
|
||||
|
||||
#include "config.h"
|
||||
#include "cc_base.h"
|
||||
#include "cc_item.h"
|
||||
@@ -46,9 +46,9 @@ class CComponentsForm : public CComponentsItem
|
||||
int append_y_offset;
|
||||
|
||||
///property: count of pages of form
|
||||
u_int8_t page_count;
|
||||
uint8_t page_count;
|
||||
///property: id of current page, default = 0 for 1st page
|
||||
u_int8_t cur_page;
|
||||
uint8_t cur_page;
|
||||
///scrollbar width
|
||||
int w_sb;
|
||||
///returns true, if current page is changed, see also: setCurrentPage()
|
||||
@@ -156,20 +156,20 @@ class CComponentsForm : public CComponentsItem
|
||||
///sets alignment offset between items
|
||||
virtual void setAppendOffset(const int &x_offset, const int& y_offset){append_x_offset = x_offset; append_y_offset = y_offset;};
|
||||
|
||||
///sets count of pages, parameter as u_int8_t
|
||||
///sets count of pages, parameter as uint8_t
|
||||
///NOTE: page numbers are primary defined in items and this values have priority!! Consider that smaller values
|
||||
///than the current values can make problems and are not allowed, therefore smaller values than
|
||||
///current page count are ignored!
|
||||
virtual void setPageCount(const u_int8_t& pageCount);
|
||||
virtual void setPageCount(const uint8_t& pageCount);
|
||||
///returns current count of pages,
|
||||
///NOTE: page number are primary defined in items and secondary in form variable 'page_count'. This function returns the maximal value from both!
|
||||
virtual u_int8_t getPageCount();
|
||||
virtual uint8_t getPageCount();
|
||||
///sets current page
|
||||
virtual void setCurrentPage(const u_int8_t& current_page){cur_page = current_page;};
|
||||
virtual void setCurrentPage(const uint8_t& current_page){cur_page = current_page;};
|
||||
///get current page
|
||||
virtual u_int8_t getCurrentPage(){return cur_page;};
|
||||
virtual uint8_t getCurrentPage(){return cur_page;};
|
||||
///paint defined page number 0...n
|
||||
virtual void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
virtual void paintPage(const uint8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
///enum page scroll modes
|
||||
enum
|
||||
{
|
||||
|
@@ -401,12 +401,12 @@ int CComponentsWindow::addWindowItem(CComponentsItem* cc_Item)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CComponentsWindow::setCurrentPage(const u_int8_t& current_page)
|
||||
void CComponentsWindow::setCurrentPage(const uint8_t& current_page)
|
||||
{
|
||||
ccw_body->setCurrentPage(current_page);
|
||||
}
|
||||
|
||||
u_int8_t CComponentsWindow::getCurrentPage()
|
||||
uint8_t CComponentsWindow::getCurrentPage()
|
||||
{
|
||||
return ccw_body->getCurrentPage();
|
||||
}
|
||||
@@ -439,7 +439,7 @@ void CComponentsWindow::paintCurPage(bool do_save_bg)
|
||||
paint(do_save_bg);
|
||||
}
|
||||
|
||||
void CComponentsWindow::paintPage(const u_int8_t& page_number, bool do_save_bg)
|
||||
void CComponentsWindow::paintPage(const uint8_t& page_number, bool do_save_bg)
|
||||
{
|
||||
CComponentsWindow::setCurrentPage(page_number);
|
||||
CComponentsWindow::paintCurPage(do_save_bg);
|
||||
|
@@ -371,14 +371,14 @@ class CComponentsWindow : public CComponentsForm, CCHeaderTypes
|
||||
* @li expects type const int&
|
||||
* @note This is simliar to setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object.
|
||||
*/
|
||||
void setCurrentPage(const u_int8_t& current_page);
|
||||
void setCurrentPage(const uint8_t& current_page);
|
||||
|
||||
/**
|
||||
* Gets current page number
|
||||
* @return CComponentsFrmChain*
|
||||
* @note This simliar to getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object
|
||||
*/
|
||||
u_int8_t getCurrentPage();
|
||||
uint8_t getCurrentPage();
|
||||
|
||||
/**
|
||||
* Paints window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage()
|
||||
@@ -390,11 +390,11 @@ class CComponentsWindow : public CComponentsForm, CCHeaderTypes
|
||||
/**
|
||||
* Paints defined page of body, parameter number 0...n
|
||||
* @param[in] page_number
|
||||
* @li expects type const u_int8_t& as page number
|
||||
* @li expects type const uint8_t& as page number
|
||||
* @param[in] do_save_bg
|
||||
* @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode
|
||||
*/
|
||||
void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
void paintPage(const uint8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
|
||||
/**
|
||||
* enable/disable page scroll
|
||||
|
@@ -137,7 +137,7 @@ class CComponentsItem : public CComponents
|
||||
///sets page location of current item, parameter as uint8_t, see: cc_page_number
|
||||
virtual void setPageNumber(const uint8_t& on_page_number){cc_page_number = on_page_number;};
|
||||
///returns current number of page location of current item, see: cc_page_number
|
||||
virtual u_int8_t getPageNumber(){return cc_page_number;};
|
||||
virtual uint8_t getPageNumber(){return cc_page_number;};
|
||||
|
||||
///set screen x-position, parameter as int
|
||||
virtual void setXPos(const int& xpos);
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
#include <gui/color_custom.h>
|
||||
#include <vector>
|
||||
#include <sys/types.h>
|
||||
|
||||
struct gradientData_t;
|
||||
class Font;
|
||||
|
@@ -34,25 +34,25 @@
|
||||
#define __MTD_FTL_USER_H__
|
||||
|
||||
typedef struct erase_unit_header_t {
|
||||
u_int8_t LinkTargetTuple[5];
|
||||
u_int8_t DataOrgTuple[10];
|
||||
u_int8_t NumTransferUnits;
|
||||
uint8_t LinkTargetTuple[5];
|
||||
uint8_t DataOrgTuple[10];
|
||||
uint8_t NumTransferUnits;
|
||||
u_int32_t EraseCount;
|
||||
u_int16_t LogicalEUN;
|
||||
u_int8_t BlockSize;
|
||||
u_int8_t EraseUnitSize;
|
||||
uint8_t BlockSize;
|
||||
uint8_t EraseUnitSize;
|
||||
u_int16_t FirstPhysicalEUN;
|
||||
u_int16_t NumEraseUnits;
|
||||
u_int32_t FormattedSize;
|
||||
u_int32_t FirstVMAddress;
|
||||
u_int16_t NumVMPages;
|
||||
u_int8_t Flags;
|
||||
u_int8_t Code;
|
||||
uint8_t Flags;
|
||||
uint8_t Code;
|
||||
u_int32_t SerialNumber;
|
||||
u_int32_t AltEUHOffset;
|
||||
u_int32_t BAMOffset;
|
||||
u_int8_t Reserved[12];
|
||||
u_int8_t EndTuple[2];
|
||||
uint8_t Reserved[12];
|
||||
uint8_t EndTuple[2];
|
||||
} erase_unit_header_t;
|
||||
|
||||
/* Flags in erase_unit_header_t */
|
||||
|
Reference in New Issue
Block a user