~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

Viewing changes to compizconfig/libcompizconfig/src/main.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-08-22 06:58:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3352.
  • Revision ID: package-import@ubuntu.com-20130822065807-17nlzez0d30y09so
Tags: upstream-0.9.10+13.10.20130822
ImportĀ upstreamĀ versionĀ 0.9.10+13.10.20130822

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
Bool
95
95
ccsObjectAddInterface_(CCSObject *object, const CCSInterface *interface, int interface_type)
96
96
{
97
 
    object->n_interfaces++;
 
97
    ++object->n_interfaces;
98
98
 
99
99
    if (object->n_allocated_interfaces < object->n_interfaces)
100
100
    {
111
111
            if (iface_types)
112
112
                (*object->object_allocation->free_) (object->object_allocation->allocator, iface_types);
113
113
 
114
 
            object->n_interfaces--;
 
114
            --object->n_interfaces;
115
115
            object->n_allocated_interfaces = old_allocated_interfaces;
116
116
            return FALSE;
117
117
        }
139
139
    const CCSInterface **o = object->interfaces;
140
140
    int        *type = object->interface_types;
141
141
 
142
 
    for (; i < object->n_interfaces; i++, o++, type++)
 
142
    for (; i < object->n_interfaces; ++i, ++o, ++type)
143
143
    {
144
144
        if (object->interface_types[i] == interface_type)
145
145
            break;
151
151
    /* Now clear this section and move everything back */
152
152
    object->interfaces[i] = NULL;
153
153
 
154
 
    i++;
 
154
    ++i;
155
155
 
156
156
    const CCSInterface **oLast = o;
157
157
    int *typeLast = type;
158
158
 
159
 
    o++;
160
 
    type++;
 
159
    ++o;
 
160
    ++type;
161
161
 
162
162
    memmove ((void *) oLast, (void *)o, (object->n_interfaces - i) * sizeof (CCSInterface *));
163
163
    memmove ((void *) typeLast, (void *) type, (object->n_interfaces - i) * sizeof (int));
164
164
 
165
 
    object->n_interfaces--;
 
165
    --object->n_interfaces;
166
166
 
167
167
    if (!object->n_interfaces)
168
168
    {
181
181
{
182
182
    unsigned int i = 0;
183
183
 
184
 
    for (; i < object->n_interfaces; i++)
 
184
    for (; i < object->n_interfaces; ++i)
185
185
    {
186
186
        if (object->interface_types[i] == interface_type)
187
187
            return object->interfaces[i];
237
237
{
238
238
    static unsigned int start = 0;
239
239
 
240
 
    start++;
 
240
    ++start;
241
241
 
242
242
    return start;
243
243
}
3052
3052
        plugins[i].after = NULL;
3053
3053
    }
3054
3054
 
3055
 
    for (i = 0; i < len; i++)
 
3055
    for (i = 0; i < len; ++i)
3056
3056
    {
3057
3057
        CCSStringList l = ccsPluginGetLoadAfter (plugins[i].plugin);
3058
3058
        while (l)
3095
3095
            {
3096
3096
                ph = NULL;
3097
3097
 
3098
 
                for (j = 0; j < len; j++)
 
3098
                for (j = 0; j < len; ++j)
3099
3099
                    if (p == plugins[j].plugin)
3100
3100
                        ph = &plugins[j];
3101
3101
 
3118
3118
    {
3119
3119
        found = FALSE;
3120
3120
 
3121
 
        for (i = 0; i < len; i++)
 
3121
        for (i = 0; i < len; ++i)
3122
3122
        {
3123
3123
            CCSString *strPluginName;           
3124
3124
                
3133
3133
                continue;
3134
3134
 
3135
3135
            found = TRUE;
3136
 
            removed++;
 
3136
            ++removed;
3137
3137
            p = plugins[i].plugin;
3138
3138
            plugins[i].plugin = NULL;
3139
3139
 
3140
 
            for (j = 0; j < len; j++)
 
3140
            for (j = 0; j < len; ++j)
3141
3141
                plugins[j].after =
3142
3142
                    ccsPluginListRemove (plugins[j].after, p, FALSE);
3143
3143
 
3157
3157
    {
3158
3158
        ccsError ("Unable to generate sorted plugin list");
3159
3159
 
3160
 
        for (i = 0; i < len; i++)
 
3160
        for (i = 0; i < len; ++i)
3161
3161
        {
3162
3162
            ccsPluginListFree (plugins[i].after, FALSE);
3163
3163
        }
4179
4179
    if (nFile <= 0)
4180
4180
        return;
4181
4181
 
4182
 
    for (i = 0; i < nFile; i++)
 
4182
    for (i = 0; i < nFile; ++i)
4183
4183
    {
4184
4184
        if (strncmp (currentBackend, &(nameList[i]->d_name[3]), strlen (currentBackend)) == 0)
4185
4185
            continue;
4376
4376
    CCSContextPrivate *cPrivate = GET_PRIVATE (CCSContextPrivate, context);
4377
4377
 
4378
4378
    if (asprintf (&keyName, "+s%d_%s", cPrivate->screenNum, ccsSettingGetName (setting)) == -1)
 
4379
    {
 
4380
        free (sectionName);
4379
4381
        return FALSE;
 
4382
    }
4380
4383
 
4381
4384
    if (ccsIniGetString (dict, sectionName, keyName, &iniValue))
4382
4385
    {
4383
4386
        CCSSetting *newSetting = malloc (sizeof (CCSSetting));
4384
4387
 
4385
4388
        if (!newSetting)
 
4389
        {
 
4390
            free (sectionName);
 
4391
            free (keyName);
 
4392
            free (iniValue);
4386
4393
            return FALSE;
 
4394
        }
4387
4395
 
4388
4396
        ccsObjectInit (newSetting, &ccsDefaultObjectAllocator);
4389
4397
 
4484
4492
            }
4485
4493
            case TypeAction:
4486
4494
            default:
4487
 
                /* FIXME: cleanup */
 
4495
            {
 
4496
                free (newSetting);
 
4497
                free (sectionName);
 
4498
                free (keyName);
 
4499
                free (iniValue);
4488
4500
                return FALSE;
 
4501
            }
4489
4502
        }
4490
4503
 
4491
4504
        CCSSettingList listIter = upgrade->clearValueSettings;
4514
4527
        
4515
4528
        return TRUE;
4516
4529
    }
4517
 
    
 
4530
 
4518
4531
    free (keyName);
4519
4532
    free (sectionName);
4520
 
    
 
4533
    free (iniValue);
 
4534
 
4521
4535
    return FALSE;
4522
4536
}
4523
4537
 
4534
4548
    CCSContextPrivate *cPrivate = GET_PRIVATE (CCSContextPrivate, context);
4535
4549
 
4536
4550
    if (asprintf (&keyName, "-s%d_%s", cPrivate->screenNum, ccsSettingGetName (setting)) == -1)
 
4551
    {
 
4552
        free (sectionName);
4537
4553
        return FALSE;
 
4554
    }
4538
4555
 
4539
4556
    if (ccsIniGetString (dict, sectionName, keyName, &iniValue))
4540
4557
    {
4541
4558
        CCSSetting *newSetting = malloc (sizeof (CCSSetting));
4542
4559
 
4543
4560
        if (!newSetting)
 
4561
        {
 
4562
            free (sectionName);
 
4563
            free (keyName);
 
4564
            free (iniValue);
4544
4565
            return FALSE;
 
4566
        }
4545
4567
 
4546
4568
        ccsObjectInit (newSetting, &ccsDefaultObjectAllocator);
4547
4569
 
4642
4664
            }
4643
4665
            case TypeAction:
4644
4666
            default:
4645
 
                /* FIXME: cleanup */
 
4667
            {
 
4668
                free (newSetting);
 
4669
                free (sectionName);
 
4670
                free (keyName);
 
4671
                free (iniValue);
4646
4672
                return FALSE;
 
4673
            }
4647
4674
        }
4648
4675
 
4649
4676
        CCSSettingList listIter = upgrade->addValueSettings;
4675
4702
    
4676
4703
    free (keyName);
4677
4704
    free (sectionName);
 
4705
    free (iniValue);
4678
4706
 
4679
4707
    return FALSE;
4680
4708
}
4883
4911
    int                    i = 0;
4884
4912
    const char             *path = CCS_UPGRADE_PATH;
4885
4913
 
4886
 
    for (i = 0; i < nFile; i++)
 
4914
    for (i = 0; i < nFile; ++i)
4887
4915
    {
4888
4916
        CCSSettingsUpgrade *upgrade = NULL;
4889
4917
        const char *upgradeName = nameList[i]->d_name;