mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-16 19:43:09 +02:00
Declare "dirp" and "dptr" pointers just before they're needed
This commit is contained in:
parent
510d67359c
commit
4159e6925b
@ -81,9 +81,9 @@ Menu::Menu(GMenu2X& gmenu2x)
|
||||
|
||||
#ifdef HAVE_LIBOPK
|
||||
{
|
||||
struct dirent *dptr;
|
||||
DIR *dirp = opendir(CARD_ROOT);
|
||||
if (dirp) {
|
||||
struct dirent *dptr;
|
||||
while ((dptr = readdir(dirp))) {
|
||||
if (dptr->d_type != DT_DIR)
|
||||
continue;
|
||||
@ -108,12 +108,10 @@ Menu::~Menu()
|
||||
|
||||
void Menu::readSections(std::string const& parentDir)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dptr;
|
||||
|
||||
dirp = opendir(parentDir.c_str());
|
||||
DIR *dirp = opendir(parentDir.c_str());
|
||||
if (!dirp) return;
|
||||
|
||||
struct dirent *dptr;
|
||||
while ((dptr = readdir(dirp))) {
|
||||
if (dptr->d_name[0] != '.' && dptr->d_type == DT_DIR) {
|
||||
// Create section if it doesn't exist yet.
|
||||
|
Loading…
Reference in New Issue
Block a user